Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Adding Header to a HttpServletRequest inside a Servlet Filter

843841Mar 28 2007 — edited Mar 28 2007
I'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

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 25 2007
Added on Mar 28 2007
6 comments
790 views