Hi, I would recommend the first option. Session memory usage has a much bigger impact than multiple hits to the server as the memory usage grows linearly with the number of users. For retaining the previous view state, the best solution I have seen is to use a single page application, where each page in the wizard is downloaded as an HTML fragment and added to the divs inside the main page. That way, the previous 'pages' are just hidden divs and to go 'back' just unhide the previous div. ( Think of it as an Ajax based tabbed pane without the tab buttons. )
- rahul From: Asha K <keerti_maj...@yahoo.com> To: user@struts.apache.org Date: 12-05-2010 13:53 Subject: Struts : Maintaining state of the Form Hi All, I am using struts 1.3 in my application . I have a requirement to develop multiple JSP pages linked to each other( like a WIZARD) . The flow is as below. level1.jsp->level2.jsp->level3.jsp->level4.jsp In each page a list of records are displayed with few editable fields. On click of each record in the list , the corrusponding next level page (list) is displayed.User can update the list in every page by clicking the SAVE button.Also user can go to previous page by clicking the Previous button . In this case the state of the previous page should be retained. I have 2 questions regarding the design in this case: Q1 : Among the below solutions which will be the best solution to display the data on the pages. 1. On every click of the record , every time a new request is made to the server and the currosponding next level data of the record is fetched from database and next level page is displayed. -The disadvantage of this approach is number of server hits are more. As every time user will drill down till the last level and come back to the first level and takes an action (update ) . 2. To avoid the number of hits to the server, I can fetch the entire data ( ie,level 1 to level 4 data ) of the record only once and keep it into session. - The disadvantage of this approach is , since the fetched data is too huge, the session object may be overloaded and may cause performance issues. Please let me know your inputs on above solutions and please suggest if any better solution can be implemented. Q2. This is regarding Handling the "Previous" button flow. As mentioned earlier , user can click the "Previous" button of each page and go back to the previous level (with the previous state maintained) . Here if the scope of my Form object is "request" I will lose my previous page data after I send a new request .In this case I can restore the entire data by caching it on server side or storing it in session again. Please let me know if any other suitable approach can be used to restore the data of Previous page. -- View this message in context: http://old.nabble.com/Struts-%3A-Maintaining-state-of-the-Form-tp28533229p28533229.html Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you