Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

availability of ActionForm object in two action classes.

 
veena sasikumar
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65227
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to ask Strust questions in the Struts forum. I have moved this topic there for you.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
veena sasikumar
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply. It worked well.

regards
veena
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic