I have some app, where a user going to link like "..app/page/par", should be redirected to page "..app/page" and then on it page should be add some data, that I should get using parameter "par"
How can I do it, using java servlets?
I have some app, where a user going to link like "..app/page/par", should be redirected to page "..app/page" and then on it page should be add some data, that I should get using parameter "par"
How can I do it, using java servlets?
The session scope can be used to store the parameter value on the server side between the two requests.
Request 1 app/page/par
String parameterValue = request.getParameter("par");
request.getSession().setAttribute("par", parameterValue);
response.sendRedirect("app/page");
Request 2 app/page
// pass the value to the view
request.setAttribute("viewAttributeName", request.getSession().getAttribute("par"));