tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <mgai...@hotmail.com>
Subject Re: Removal of headers in HttpServletResponse object
Date Fri, 21 Jul 2006 14:09:46 GMT
Good Morning Geir-

So following the provided exampe if you setup a loop to response.getHeader
to obtain each and every header value (enumerated here at)
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

and perform a 
response.setHeader("") (except for the Date Header field which of course is mandatory)

are you able to effect the desired solution?

If this does not produce desired outcome I would look into Jon Wingfield's suggestion of 
-writing your own connector (which will specifically write its own response)
-using mod_headers to modify the outgoing headers..

Martin --
*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



----- Original Message ----- 
From: "Geir Øvsttun (AS/ETO)" <geir.ovsttun@ericsson.com>
To: "Tomcat Users List" <users@tomcat.apache.org>; "Martin Gainty" <mgainty@hotmail.com>
Sent: Friday, July 21, 2006 5:53 AM
Subject: RE: Removal of headers in HttpServletResponse object


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:geir.ovsttun@ericsson.com] 
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 :-)

-----Original Message-----
From: Martin Gainty [mailto:mgainty@hotmail.com]
Sent: 20. juli 2006 19:25
To: Geir Øvsttun (AS/ETO)
Subject: Re: Removal of headers in HttpServletResponse object

Geir-

I found a complete Tomcat Valve example here at http://www.explain-it.org/mediawiki/index.php/TomcatValve
where the invoke() method would modify the outgoing response to omit the Header ..

Sverige Altid-
Martin --
*********************************************************************
This email message and any files transmitted with it contain confidential information intended
only for the person(s) to whom this email message is addressed.  If you have received this
email message in error, please notify the sender immediately by telephone or email and destroy
the original message without making a copy.  Thank you.



----- Original Message -----
From: "Geir Øvsttun (AS/ETO)" <geir.ovsttun@ericsson.com>
To: <users@tomcat.apache.org>
Sent: Thursday, July 20, 2006 6:09 AM
Subject: Removal of headers in HttpServletResponse object


Hi ,

For fast prototyping and test purposes I am trying to simulate the responses of various devices
(web cameras with embedded web servers) by using Tomcat.
The problem I have is that Tomcat (5.5.17) seems to add by default the following headers to
the HTTP/1.1 200 OK response:

Server: Apache-Coyote/1.1
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 82
Date: Thu, 20 Jul 2006 09:53:33 GMT

These headers are not included by the various embedded devices I am trying to simulate.

As the HttpServletResponse class does not have a removeHeader method (only add... And set...)
I am stuck.

I have tried to look into the use of Filters but to my understanding the Filter also relies
on the methods of HttpServletResponse for manipulation of the response object.

Can Tomcat in any way be configured to not include the headers ?
Are there any other way to remove the headers ?

Geir :-)  

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

Mime
View raw message