My page flow is like,
Jsp1 -> Jsp2 -> ... -> Servlet -> JspN -> ...
where, Jsp1 is log in page where user has to give password and username. Now, I want to use username and password value in servlet page. Is it possible to get those value in servlet without passing parameters from Jsp1 to Jsp2 …. to Servlet?
You can set them in session in
Jsp2stage. Get the parameters from request and set them in session as so:To be able to do this, your
Jsp1should have fields defined with the same names as the request parameters.Then in the
Servlet, you can simply read them as so: