File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem while Navigation in Struts.

 
Priya Jotwani
Ranch Hand
Posts: 53
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have 4 JSP pages in my application. Saying Next leads me to the next JSP Page and Cancel always takes me to the first JSP page with default values loaded.Saying Previous takes me to the previous page with the selected values restored.
All this is to implemented using Struts ,having a Single Action Class and a Single Form Bean.
My Page 1 contains 2 Combo Boxes
My Page 2 contains 2 Listboxes. The user selects some items of List 1 and moves into List 2. Saying Next should save the List 2 and take me to Page 3.
Page 3 again has exactly the same scenario as Page 2 .Saying Next takes me to Page 4.
Page 4 again contain 2 Combo Boxes.
I should go on appending the field values of Pages I navigate in the Request so that its available in my Formbean. So in my Action class I get the request parameter values of Page 1 and set it again in the Request .In Page 2, I have a hidden variable corr. to fields of Page 1 and I assign the values by doing request.getAttribute.
How should I do the same thing for storing my Listbox values of Page 2 in the request and then how do I retrieve the same in Page 3 ?

Thanks in Advance,
Priya
 
Eusebio Floriano
Ranch Hand
Posts: 237
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why dont you put it in the session ?
I would solve your problem.
 
sreenath reddy
Ranch Hand
Posts: 415
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi priya

In the above cases its always better to store the values in session mean make the scope of the form bean session and at any time clean that once if u want.............see the best example in all the commercial websites where u do online purchase will be 4-5 step process but at the end they will give the summary in one page (all the parameters in the 4-5 step process) i all these cases the data will be persisted in session

that too placing 4-5 lists wont affect ur performance too
 
Priya Jotwani
Ranch Hand
Posts: 53
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the Reply.
but my problem is that I CANNOT put it in Session(not my decision )
The main thing I am stuck is I don't know how to pass the list from Page 2 so that it is avaialble in subsequent request. I want it the way I am retrieving the value of combo in Action class by saying request.getParameter() and then again setting it in the Request so that it is avaialable in the next page.
Any ideas how this could be done ?
Also, would like to know if there is Listbox tag in Struts ?

TIA,
Priya
 
Rovas Kram
Ranch Hand
Posts: 135
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Priya, correct me if I'm wrong but isn't your question just a basic servlet question? How do you get the values selected by the user in ListBox? I mean if you knew, you would just pass those values to the next page using request.setAttribute, right?
[ September 01, 2004: Message edited by: Rovas Kram ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic