• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Data across multiple actions

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use hidden form fields to save the data.
 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Dom Lassy and Kristof Camelbeke.
It helped solve the problem.
 
A magnificient life is loaded with tough challenges. En garde tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic