Your filter would create a HttpServletResponseWrapper. The wrapper would override the setHeader and addHeader methods to be no-ops. But certain headers will still be sent (unless you ovveride the Connector)

-Tim

COURTAULT Francois wrote:

I don't see in the servlet api a way to clear or reset the headers ?

You can only add a header .... so I don't know how you can remove header with a servlet filter ?
Regards.

-----Message d'origine-----
De : Bruno Georges [mailto:[EMAIL PROTECTED]
Envoyé : vendredi 6 janvier 2006 15:06
À : Tomcat Users List
Cc : users@tomcat.apache.org
Objet : Re: Way to force Tomcat not to send headers in its http response.

Francois

I would use a Servlet Filter to do this. It is a standard, not tomcat specific 
and it allows you to decouple the header processing from your existing servlet 
and it is also very flexible.
you will be handle to handle both HTTP response and request headers.

Hope this helps.
Bruno Georges

Glencore International AG
Tel. +41 41 709 3204
Fax +41 41 709 3000


|---------+-------------------------------->
|         |           "COURTAULT Francois" |
|         |           <[EMAIL PROTECTED]|
|         |           emplus.com>          |
|         |                                |
|         |           06.01.06 14:02       |
|         |           Please respond to    |
|         |           "Tomcat Users List"  |
|         |                                |
|---------+-------------------------------->
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                             
                                                                     |
  |        To:      <users@tomcat.apache.org>                                   
                                                                     |
  |        cc:                                                                  
                                                                     |
  |        Subject: Way to force Tomcat not to send headers in its http 
response.                                                                    |
  |                                                                             
                                                                     |
  |Distribute:                                                                  
                                                                     |
  |Personal?               |-------|                                            
                                                                     |
  |                        | [ ] x |                                            
                                                                     |
  |                        |-------|                                            
                                                                     |
  |                                                                             
                                                                     |
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|




Hello,

Do you know if there is a way to force Tomcat not to send http headers in its 
http response ?

Regards.




LEGAL DISCLAIMER. The contents of this e-mail and any attachments are strictly 
confidential and they may not be used or disclosed by someone who is not a 
named recipient.
If you have received this email in error please notify the sender by replying to this 
email inserting the word "misdirected" as the message and delete this e-mail 
from your system.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to