File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data across multiple actions

 
Shibin Paul
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to use the same ActionForm across multiple actions?
How do you get the data into another action which is not part of the original action mapping in struts-config file?

Thanks in advance
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Shibin Paul:
Is it possible to use the same ActionForm across multiple actions?
Yes, it is. Just refer to the same form-bean name in each action mapping.
Originally posted by Shibin Paul:
How do you get the data into another action which is not part of the original action mapping in struts-config file?

Suppose you have just submitted a form to an action that uses ActionForm1 and you want to pass the value of the property foo to another page that uses ActionForm2. The following code would do the job.

[ May 07, 2007: Message edited by: Merrill Higginson ]
 
Shibin Paul
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is there is a user form which the user fills when he hits the submit button it moves to the confirmation page on which there is a ok button.When you hit the ok button the data should fill a database.I am using the same actionForm across.Problem occurs when I try to populate the database the user DataForm gets reset.So how do you get the data across.I am using the request scope.

Thank you
 
Dom Lassy
Ranch Hand
Posts: 181
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use hidden form fields to save the data.
 
Kristof Camelbeke
Ranch Hand
Posts: 97
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean that the data is lost after submitting the confirmation screen ?
If this is the case you might want to use the session scope instead of the request...

Hope this helps
 
Shibin Paul
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Dom Lassy and Kristof Camelbeke.
It helped solve the problem.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic