File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes availability of ActionForm object in two action classes. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "availability of ActionForm object in two action classes." Watch "availability of ActionForm object in two action classes." New topic
Author

availability of ActionForm object in two action classes.

veena sasikumar
Greenhorn

Joined: Nov 27, 2006
Posts: 29
Hi,

Is it possible to pass an ActionForm object from one Action class to another. Each Action class is having separate ActionForm object and I would like to get the ActionForm object associated with the previous Action class along with the ActionForm object of the current one.

thanks and regards

veena
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61001
    
  65

Please be sure to ask Strust questions in the Struts forum. I have moved this topic there for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
An ActionForm is always stored in either request scope or session scope. If you want to access an ActionForm from a previous action, just specify "session" as its scope, and it will be available to you in subsequent actions. You can then retrieve it from session scope like this:

where myForm is the name you gave to the ActionForm when you defined it in the struts-config.xml file.

If you know you won't be needing the form any more after this operation, you can help system performance by removing it from the session:

[ January 14, 2007: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
veena sasikumar
Greenhorn

Joined: Nov 27, 2006
Posts: 29
Thanks for the reply. It worked well.

regards
veena
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: availability of ActionForm object in two action classes.