File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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

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="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: How to "carry" JSP form input over few pages (clicks) down ?
It's not a secret anymore!