Another approach would be to put Apache in front and use mod_headers:

http://httpd.apache.org/docs/1.3/mod/mod_headers.html
http://httpd.apache.org/docs/2.0/mod/mod_headers.html

Note: I've not tried this approach and don't know if you can remove mandatory headers...

Jon Wingfield wrote:
You'll probably need to write your own connector!

See prepareResponse method:
http://svn.apache.org/repos/asf/tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11Processor.java http://svn.apache.org/repos/asf/tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java

In any case, at the very least the Date header is mandatory in the response for an HTTP/1.1 response (see rfc2616).

Jon

Geir Øvsttun (AS/ETO) wrote:
Hi all,

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 ?

Geir :-)
-----Original Message-----
From: Geir Øvsttun (AS/ETO) [mailto:[EMAIL PROTECTED] Sent: 21. juli 2006 08:41
To: Martin Gainty; users@tomcat.apache.org
Subject: RE: Removal of headers in HttpServletResponse object

Hi Martin,

Thanks for the feedback but I am afraid that the example did not really solve my problem.

As far as I can understand your example only includes adding a header not removing. It also relies on the standard HttpServletResponse methods which does not include a removeHeader method.

Geir :-)




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to