This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes How to Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to "carry" JSP form input over few pages (clicks) down ?" Watch "How to "carry" JSP form input over few pages (clicks) down ?" New topic
Author

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

steve francisco
Ranch Hand

Joined: Jan 26, 2005
Posts: 46
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

Joined: Apr 14, 2005
Posts: 354
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.


-/a<br />certified slacker...yes, my last name is 'do' - <a href="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to "carry" JSP form input over few pages (clicks) down ?
 
Similar Threads
access objects in a session
Problem with Forward
Struts forward problem
action chaining
How to do Action mapping for this scenario ??