tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Schönhaber <>
Subject Re: Removal of headers in HttpServletResponse object
Date Fri, 21 Jul 2006 10:06:52 GMT
Geir Øvsttun wrote:
> I am still struggling with the removal of header problem.
> I found that the ServletResponse has a reset() method which should delete
> all headers. I thought maybe I could use this and then reconstruct the
> response object with only the headers I want. I tried to do call this
> method in the http servlet code itself but when the object is returned
> Tomcat reconstruct the original headers before sending the response to the
> client.
> For this to work must the reset() method be called from a Filter or a Valve
> ?

AFAICT the HttpServletResponse object a Filter sees doesn't contain the Date 
and Server header fields. These seem to be added later in the response chain. 
I therefore doubt a filter will help you. Maybe a valve will get the task 
done, but since I've never worked with a homegrown Valve, I don't know.


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message