I want to store a HttpServletRequest
object in a HttpSession
as an attribute.
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.getSession().setAttribute("ses",request);
Here is how I get it back in another servlet,
HttpSession ses=r.getSession(false);
HttpServletRequest rq=(HttpServletRequest)ses.getAttribute("ses");
Here rq is not nul when I check it in a if
statement. My problem is, when I try to get a parameter which is in the request object, a null-point exception is thrown. How can I store a request as I can get parameters back again?