File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Passing data from jsp to jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Passing data from jsp to jsp" Watch "Passing data from jsp to jsp" New topic
Author

Passing data from jsp to jsp

Martin Baldwin
Greenhorn

Joined: Jun 21, 2013
Posts: 8
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

Joined: Jan 10, 2002
Posts: 61206
    
  66

WHy not aggregate the data in the session?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Martin Baldwin
Greenhorn

Joined: Jun 21, 2013
Posts: 8
Like this?

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61206
    
  66

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

Joined: Jul 17, 2013
Posts: 9

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
 
subject: Passing data from jsp to jsp