Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to "carry" JSP form input over few pages (clicks) down ?

 
steve francisco
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose my scenario is --- JSP1 --(calls)--> ActionServlet -(calls Action1)-then-(forward to)--> JSP2 - calls ActionServlet --(calls Action2)--then-forward-to --> JSP3 -->....

When "Action2" is called it can get "JSP2"'s input by access JSP2's FormBean. But I want "Action2" utilizes "JSP1"'s FormBean as well, however, for some reason I set the scope to "request" which means FormBean1 for JSP1 can't be available by default. SO, how to "carry" JSP1's FormBean ? Using hidden variable ? How to use hidden variable in struts ? Haven't seen any example yet so not sure if it is a good idea.
 
alan do
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you need to set the action scope to 'session'; otherwise the form-bean instance is destroyed after each request.

you may consider finding an online guide or a book that shows you how to do 'multipage' form. the most difficult part in multipage form is the validation, which i think you'll run into.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic