File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Design Issue(Urgent) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Design Issue(Urgent)" Watch "Design Issue(Urgent)" New topic

Design Issue(Urgent)

Angela D'souza
Ranch Hand

Joined: Jan 16, 2002
Posts: 469
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?
Craig Jackson
Ranch Hand

Joined: Mar 19, 2002
Posts: 405
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
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
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
Angela D'souza
Ranch Hand

Joined: Jan 16, 2002
Posts: 469
Nitin Barhanpurkar

Joined: Apr 01, 2003
Posts: 8
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.
I agree. Here's the link:
subject: Design Issue(Urgent)
It's not a secret anymore!