Adding Header to a HttpServletRequest inside a Servlet Filter
843841Mar 28 2007 — edited Mar 28 2007I'm trying to get a solution working with a servlet filter where I'm trying to get the following thing to work:
When a request from the client arrives at the Servlet filter (so before going into the real Servlet) it contains a header containing the username of this user. Once inside the Servlet filter the http header variable value needs to changed in to another user (This can be another http header variable or could be the same).
Now I don't see how the HttpServletRequest can add a header value (or change) before the request is send to the real servlet.
I've looked at the Servlet specification and it should be possible to accomplish.
So basically what I need is to add an header to the HttpServletRequest when processed by the Servlet Filter before it is send to the Servlet (chain.doFilter)
Thnx
Frederik