I'm having a problem with HttpServletRequest object which I save as a session attribute in order to retrieve its properties later.
HttpServletRequest originalRequest = request;
HttpServletRequest originalRequest = (HttpServletRequest)session.getAttribute("originalRequest");
The problem is that originalRequest.getRequestURI() is null, although an HttpSessionAttributeListener shows that the attribute was saved correctly (attributeAdded: originalRequest.getRequestURI() is correct), and that it had not been replaced or removed.
My question is:
How to prevent changes to the request object saved as a session attribute and how to access this request object from another servlet?