Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing an object between actions.

 
Muthukrishnan Manoharan
Ranch Hand
Posts: 91
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have an object created in action class (action1) as a result of user entering details in a form (say form1).
Now I have next form as form2 where user enters some more details for that object.
Initially I put the object created during action1 into the request scope. Now i would like to know how will i retrieve the object at form2 and pass it on to action2 using struts tag, so that I can add some more details to the same object as given by the user in the form2.

I am sorry if I am not clear with my explanations. Please tell me if I should rephrase it..

Thanks,
Muthu
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You either need to save the first form in session (or a data transfer object) or use hidden form fields.
 
Muthukrishnan Manoharan
Ranch Hand
Posts: 91
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First thanks a lot for the reply.

Can you please elaborate me how I can do that.
For example if I am storing the object in session in the form1 action(ie action1), I would like to know how I can access that object in form2.jsp using struts tag and pass it to the form2 action..

And one more thing - Can I use hidden field for custom objects.

Thanks,
Muthu
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic