This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
In ActionClass we can use only one action i.e execute(), but in DispatchAction we can use multiple actions.My question is , we can use multiple actions in Action class if(action.equals("add") ,if(action.equals("update"). Then when to use Action and DispatchAction which is frequently in webapplications.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35241
7
posted
0
Is this some specific framework you're asking about? If so, which one?
This is the struts framework. Not sure which one is used more than the other. I have worked on applications that use both. I guess it depends on if you have several action paths, and the functionaluty of each path is similar, then the dispath action may come in handy. Especially if the same form bean is being used for all the different paths/actions.
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Doing conditional logic in an execute() method is just one way (a messy one) to implement DispatchActon. I can't think of any particular reason to do the work manually when a mechanism already exists--except if the decision-making process is more difficult than a simple string (for example, which method might depend on a combination of factors).
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.