You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Hanks Wang (hanwan)" <ha...@cisco.com> on 2008/02/22 07:27:51 UTC

How to modify default tomcat http header property "Server: Apache-Coyote/1.1" ?

Hi all,
 
I deployed a servlet in Tomcat which sends  response to all http post
requests, and I composed the response data by HttpServletResponse
object.
 
But I found Tomcat will generate a default http header property in the
response: "Server: Apache-Coyote/1.1"
 
So my question is : Is there a way to change the value? eg: change it to
"Server: For-Test"
 
I try to use below method: 
response.setHeader("Server", "For-Test");
 
Then the http header becomes to:
Server: Apache-Coyote/1.1
Server: For-test
 
But the "Apache-Coyote/1.1" still there.  So how can I delete it or
modify it? Thanks!
 
B.R
Han
 

RE: How to modify default tomcat http header property "Server: Apache-Coyote/1.1" ?

Posted by "Hanks Wang (hanwan)" <ha...@cisco.com>.
Thanks for your help David.

 Get the answer, write it here in case someone meets same problem in
future:
 
add server attribute in Connector element of the conf/server.xml,
something like this:
 
<Connector .... server="test" ... >
 
Thanks
Han 

-----Original Message-----
From: David Smith [mailto:dns4@cornell.edu] 
Sent: Friday, February 22, 2008 6:29 PM
To: Tomcat Users List
Subject: Re: How to modify default tomcat http header property "Server:
Apache-Coyote/1.1" ?

You didn't mention which version of tomcat you are using.  Starting w/
5.5, the server attribute can be added to the Connector in server.xml.  
See http://tomcat.apache.org/tomcat-5.5-doc/config/http.html for further
details.

--David

Hanks Wang (hanwan) wrote:
> Hi all,
>  
> I deployed a servlet in Tomcat which sends  response to all http post 
> requests, and I composed the response data by HttpServletResponse 
> object.
>  
> But I found Tomcat will generate a default http header property in the
> response: "Server: Apache-Coyote/1.1"
>  
> So my question is : Is there a way to change the value? eg: change it 
> to
> "Server: For-Test"
>  
> I try to use below method: 
> response.setHeader("Server", "For-Test");
>  
> Then the http header becomes to:
> Server: Apache-Coyote/1.1
> Server: For-test
>  
> But the "Apache-Coyote/1.1" still there.  So how can I delete it or 
> modify it? Thanks!
>  
> B.R
> Han
>  
>
>   


---------------------------------------------------------------------
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


---------------------------------------------------------------------
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


Re: How to modify default tomcat http header property "Server: Apache-Coyote/1.1" ?

Posted by David Smith <dn...@cornell.edu>.
You didn't mention which version of tomcat you are using.  Starting w/ 
5.5, the server attribute can be added to the Connector in server.xml.  
See http://tomcat.apache.org/tomcat-5.5-doc/config/http.html for further 
details.

--David

Hanks Wang (hanwan) wrote:
> Hi all,
>  
> I deployed a servlet in Tomcat which sends  response to all http post
> requests, and I composed the response data by HttpServletResponse
> object.
>  
> But I found Tomcat will generate a default http header property in the
> response: "Server: Apache-Coyote/1.1"
>  
> So my question is : Is there a way to change the value? eg: change it to
> "Server: For-Test"
>  
> I try to use below method: 
> response.setHeader("Server", "For-Test");
>  
> Then the http header becomes to:
> Server: Apache-Coyote/1.1
> Server: For-test
>  
> But the "Apache-Coyote/1.1" still there.  So how can I delete it or
> modify it? Thanks!
>  
> B.R
> Han
>  
>
>   


---------------------------------------------------------------------
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