• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP: "response" object to be forwarded via link

 
Vikas Aggarwal
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I ahve a JSP form for creation of an employee data in database. After each successful creation we get a confirmationpage. The confirmationpage has a link and onclick of this link I want to show the exactly same contents that the confirmation page itself has BUT without executing the business logic.
I though of some thing like this. Please let me know if this is correct and also how to implement it in JSP.
The "response" object in the confirmation page (first time) has all the content. I will pass this object to the a dummy JSP in request. the dummy JSP will try to get the content from this object and convert it to "String" or "StringBuffer". After that the "out" object in dummy jsp will write the content to the browser. This content will exactly look like the first time.
Please correct me if I am wrong somewhere.
Thanks
 
Ramesh Pusunuru
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I want to show the exactly same contents that the confirmation page itself has BUT without executing the business logic.
Looks like you want to show the form contents in confirmation Page.You can do this below way
Employee Details entry JSP --> Updation sevlet
(Servlet reads form variables and updates Database)
If updation is sucessful -> send the entered values object by request.setattribute(Objectcontaining deatils) to confirmation JSP i.e
Update servlet -> request dispacther ->confimation JSP
I hope you got
Thanks
Ramesh
SCJP2
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!