Hi, I have five pages where user enter data in this five different page. Finally last page(fifth page) user will click on save, all data of five pages must be save to permnant database. I am thinking when user jump between pages & enter the data, those data I can store in session temprary and finally on last page, when user click on Save button, I can get all data from session object & put in permanent database. Now question is to store & get data in session should I user jsp or servlet??? Why? Thanks, Angela
I would choose to go with the servlet. Because you may be talking about developing a lot of business logic i.e. data access, form validation, error handling, redirection etc. To me adding this type of detail in a JSP can cause a JSP page to become unmaintainable. If you are not going to use the JSP page to display content, I would go with the servlet. My $0.02 Craig.
Near the middle of this page is a list of places you can keep data while navigating pages. I'm certain it is not complete, and I may have made up #5. I can probably fabricate requirements to lead to any of the 8. You'll want to work from your own requirements. Re the JSP / Servlet question, I like using servlets (or maybe ONE servlet) to receive requests, call out to the model layer to process them, then transfer to a JSP to build the response. I think this is about universal nowadays. See the Struts architecture diagrams. [ April 10, 2003: Message edited by: Stan James ]
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I had a similar type of scenario. So I created an intermediate jsp file which will store various values. On submitting each page, this intermediate jsp page is called & the values are stored in variables. Now when Save is clicked on the last page all the data in the variables are stored in the database.