wood burning stoves 2.0*
The moose likes Struts and the fly likes Action Form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Action Form" Watch "Action Form" New topic

Action Form

Parijat Mukherjee

Joined: Sep 21, 2003
Posts: 26
Can i use any action form for performing more than one action .
like i have a form manageproject i have 3 actions add , update , delete
now i have a hidden property by which i choose the action class but the problem is in case of add and delete since on sucess as well as failure i return back to same jsp where as i am confused how to put the update entry in struts config
rahul V kumar
Ranch Hand

Joined: May 20, 2003
Posts: 82
DispatchAction class might work for you. You will be having only one action class but different methods each for a specific action. And you can have one ActionForm or DynaActionForm whichever way you want to do it.
Refer to lesson 3 of this link http://www.reumann.net/do/struts/main
Hope this helps
Norma Caballero

Joined: Jan 30, 2004
Posts: 27
What we do in the project Im working on, is that we create a BaseAction for each module, this BaseAction has all the methods needed to perform the actions. And then we create an AddAction.java, DeleteAction.java and UpdateAction.java and we make calls to the methods created in BaseAction.java
I think it doesn't matter if two actions return to the same jsp, you can specify that in struts-config.xml in the forward name tag inside the action entry you specify.
Good luck!
Consider Paul's rocket mass heater.
subject: Action Form
Similar Threads
Passing data from JSF page in the backing bean
mutliple rows update and delete
Urgent! Action and forms
How to do two actions on a same Form in Struts?
DispatchAction problem