wood burning stoves 2.0*
The moose likes Tomcat and the fly likes disable tomcat version display Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "disable tomcat version display" Watch "disable tomcat version display" New topic
Author

disable tomcat version display

shivani anand
Ranch Hand

Joined: Dec 28, 2000
Posts: 155
Hi,

Right now when I type certail url which is using tomcat I get 404 error and also apache tomcat version . Due to security reason we do not want to display apache tomcat version. Could anyone please let me know how to disable this?

thanks
SA
Theodore Casser
Ranch Hand

Joined: Mar 14, 2001
Posts: 1902

Best suggestion I can offer off the top of my head would be to write custom error pages for each application you're hosting, and a generic one for the entire server.

For the entire server, you're going to want to include this code in your $CATALINA_HOME/conf/web.xml file to block 404 errors (for example):


But, basically, if you override the default functionality, it should help you hide the footer that lists the version.


Theodore Jonathan Casser
SCJP/SCSNI/SCBCD/SCWCD/SCDJWS/SCMAD/SCEA/MCTS/MCPD... and so many more letters than you can shake a stick at!
Prashanth Chandra
Ranch Hand

Joined: Dec 07, 2005
Posts: 79
Hi
Create a error.jsp page and include the following in your web.xml file. Hope this might be of some help.

<web-app>

<error-page>
<error-code>404</error-code>
<location>/error.jsp</location>
</error-page>

[Here goes your servlet mappings and welcome file lists]

</web-app>
shivani anand
Ranch Hand

Joined: Dec 28, 2000
Posts: 155
what is location of 404.jsp . Is I need to create error.jsp where should I create one

thanks
SA
shivani anand
Ranch Hand

Joined: Dec 28, 2000
Posts: 155
I know where to create error.jsp but still I'll like to know where 404.jsp is located as I'll prefer jsu to remove version info from there.

thanks
SA
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: disable tomcat version display