This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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
Author

Action Form

Parijat Mukherjee
Greenhorn

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
Greenhorn

Joined: Jan 30, 2004
Posts: 27
Hi,
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!
 
Have you checked out Aspose?
 
subject: Action Form
 
It's not a secret anymore!