tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric B." <ebe...@hotmail.com>
Subject Re: Custom 404 for non-existant contexts?
Date Wed, 06 Feb 2008 23:03:02 GMT
"Caldarale, Charles R" <Chuck.Caldarale@unisys.com> wrote in message 
news:2828B04F0113CD468E6D1D51DF4362A404CC2281@USEA-EXCH2.na.uis.unisys.com...
>> Subject: Custom 404 for non-existant contexts?
>>
>> 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>


and put the /error/maintenance.html in the ROOT directory.

Of course, the ugly part about this is that a) /error/maintenance.html is 
now accessible through my root app (unless otherwise protected), and I need 
to have a separate ROOT/error/maintenance.html for each individual Tomcat 
instance.  I was hoping to be able to centralize the error msgs (as in 
httpd), but didn't have any success.  I tried using a symlink to point my 
error/ folder to a central location, but Tomcat didn't follow the link.

Not the prettiest soln, but functional.  Would be nice if I could make it 
nicer tho.

Thanks,

Eric





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


Mime
View raw message