Redirecting a request from one jsp to another jsp with all request parameters?

I have such a scenario. The user enters some things in the form of jsp in the browser and submits. In the servlet, I process the request and show jsp page1 to the client who just continued the button. Now, by clicking continue, I want to forward this request to another jsp2 page with all the request parameter presented on page 1. basically, I want to get all the request parameters that were in the first request on page 2? I do not understand how I should go for this? I don’t think I can use jsp forward in accordance with my understanding that this will only work if we want to switch from jsp (on the server side) not on the client side?

+3
source share
2 answers

There are two ways to implement this:

  • display all parameters in hidden fields and send them to the 2nd request
  • save everything in session
+4
source

Below are two ways to achieve this.

  • Put the information in the session object in the first request and access it from the session object in the second.

  • On the intermediate page, hidden form elements are displayed that will carry values ​​and send them to continue.

+1
source

All Articles