Meaningless Drivel is fun!*
The moose likes Struts and the fly likes Design question 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 "Design question" Watch "Design question" New topic
Author

Design question

Ajay Xavier
Ranch Hand

Joined: Jan 03, 2005
Posts: 109
hi,

I have an existing struts application consisting of three JSP pages say page1, page2 and page3 and a form bean (for all these pages) and
an action class(using DispatchAction).

I need to append two jsp pages one at the end and other at the begining. The flow will be

newPage1->page1->page2->page3->newPage2

User can select either the old flow or new flow. when user select the new flow, inputs given in the newPage1 are used at the Page1, page2 and other pages.

I created a new form bean, Action class and value object for the new flow. I populated the VO with info in newPage1 and placed it in HttpSession. Page1, page2 and page3 uses the VO in Httpsession. The values selected in these pages are updated in VO. Finally, newPage2 uses the VO for further proceedings.

Is this the best way of doing this?
Is it a good idea to maintain objects across session?

Regards,
Ajay.
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
What you are doing sounds about like what I have done for wizard type pages. If you are not storing data in the session you have to carry it along using hidden fields in your jsp (or I suppose you could save it to a repository...like a database).

- Brent
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Design question
 
Similar Threads
Assigning String object to bean class reference variable/jsp:usebean issue
How to make a JSP/HTML page to stay on itself when user clicks on back button on the browser?
help for jsf
forward action
declarative validation of wizard pages