Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Design Issue(Urgent)

 
Angela D'souza
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Craig Jackson
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Angela D'souza
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,
Angela
 
Nitin Barhanpurkar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic