Hi all,
Is it possible to remove an HTTP header from the Servlet response object? i want to remove the Authorization header, but i've found no way to do it, there's just a way to set the header but it's not sufficent.
Nabil BENMIRA
-
Remove response header! (6 messages)
- Posted by: BENMIRA Nabil
- Posted on: December 10 2003 09:38 EST
Threaded Messages (6)
- filter by Sean Sullivan on December 10 2003 12:33 EST
- filter by BENMIRA Nabil on December 11 2003 06:31 EST
- filter by Paul Strack on December 11 2003 01:13 EST
-
filter by Sean Sullivan on December 16 2003 01:39 EST
-
filter by BENMIRA Nabil on December 17 2003 04:10 EST
- com.ibm.websphere.servlet.filter by Sean Sullivan on December 17 2003 10:31 EST
-
filter by BENMIRA Nabil on December 17 2003 04:10 EST
- filter by BENMIRA Nabil on December 11 2003 06:31 EST
-
filter[ Go to top ]
- Posted by: Sean Sullivan
- Posted on: December 10 2003 12:33 EST
- in response to BENMIRA Nabil
can you write a Servlet filter class? -
filter[ Go to top ]
- Posted by: BENMIRA Nabil
- Posted on: December 11 2003 06:31 EST
- in response to Sean Sullivan
No :( i'm working on a servlet specification older than 2.3
Nabil BENMIRA -
filter[ Go to top ]
- Posted by: Paul Strack
- Posted on: December 11 2003 13:13 EST
- in response to BENMIRA Nabil
Unfortunately, once a header has been added to a response, there is no way to remove it. If you can't use filters, you are going to have to write an interceptor servlet that is functionally equivalent to do the same thing. Pass all request through the interceptor filter, replace the real response with a dummy response that caches output in memory, than process the response results in the interceptor to strip out the necessary header.
This will be pretty ugly, and may not be worth the trouble. -
filter[ Go to top ]
- Posted by: Sean Sullivan
- Posted on: December 16 2003 01:39 EST
- in response to BENMIRA Nabil
What application server are you using? -
filter[ Go to top ]
- Posted by: BENMIRA Nabil
- Posted on: December 17 2003 04:10 EST
- in response to Sean Sullivan
thanx for your responses.
I'm using Websphere 4
Servlet Specification Level : 2.2
Supported JSP Specification Level : 1.1
Nabil BENMIRA -
com.ibm.websphere.servlet.filter[ Go to top ]
- Posted by: Sean Sullivan
- Posted on: December 17 2003 10:31 EST
- in response to BENMIRA Nabil
Websphere 4.0 has a "filter" package.
Have you tried it?
http://www-306.ibm.com/software/webservers/appserv/doc/v40/ae/apidocs/com/ibm/websphere/servlet/filter/package-summary.html