tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric B." <>
Subject Re: Custom 404 for non-existant contexts?
Date Thu, 07 Feb 2008 04:05:32 GMT
> |>>
> |>> Is there a way to create a custom 404 error page for Tomcat
> |>> for non-existant context paths?
> |
> |> What happens if you declare a custom error page for the ROOT (default)
> |> webapp?
> |
> | Yeah - that's pretty much the only thing I managed to figure out.  I
> updated
> | the conf/web.xml file to include
> |    <error-page>
> |       <error-code>503</error-code>
> |       <location>/error/maintenance.html</location>
> |     </error-page>
> Note that you have modified the default web.xml for all webapps, and not
> the ROOT webapp. This may have unintended consequences for other web
> applications.
> | and put the /error/maintenance.html in the ROOT directory.
> If you have a ROOT directory, why not use ROOT/WEB-INF/web.xml instead
> of hacking the site-wide defaults?

Hmmm - good question.  Don't know why I didn't think of that.  Would just 
modifying the ROOT/WEB-INF/web.xml work?  I expected that I needed to modify 
the entire site's defaults since I didn't think that the root would suffice, 
but now that I think about it, your suggestion does sound much more logical.

FYI, I did run a couple of tests to see if the site-wide would conflict with 
an individual application, but it seems that the individual application's 
settings will override it - however, only if specified.  If not specified, 
then I can indeed forsee additional confusion occuring.

Will take another look at that tomorrow.



To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message