Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to set up custom error pages in tomcat 6, because I don't want the default ones to show up. My error pages are static html, no jsp or anything dynamic.

I know how to do this through the web.xml in each application but I'd prefere to setup the error pages only once for the entire server.

I tried to add the following fragment to the global web.xml (in conf), but no matter what I add under location, it does not show.


What do I need to do to gobally define custom error pages? Thanks!

share|improve this question
up vote 2 down vote accepted

Your syntax is correct (and worked fine for me). But you will need a file called 404.html at the root level for every webapp deployed for it to work.

If you do NOT want to do that - there is the little know errorReportValveClass as part of StandardHost in which you can provide your own implementation of a class to handle all the uncaught errors.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.