• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing data from jsp to jsp

 
Martin Baldwin
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an application where a form jsp page is called by and passes data to a servlet. However, I now want to add on additional forms where users can click a Next button to take them to a new page with a new form and at the end of the forms, click Submit and have all of the data passed back to a single servlet. Should I be passing the data from jsp to jsp or submitting back to the servlet with each click of the Next button? Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64205
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WHy not aggregate the data in the session?
 
Martin Baldwin
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Like this?

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64205
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saving it in page context will not persist it across multiple requests; that's what the session is for. You can obtain the session reference from the request.
 
william blake
Greenhorn
Posts: 9
Chrome Eclipse IDE Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use session is the best way, but you should konw othere way by request,
values are passed page A to page B by request, so page B can get values by request.getParameters("xx")

maybe it can help you。
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic