Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing http error pages on tomcat 4

Status
Not open for further replies.

hemi

Technical User
Aug 15, 2001
2
NZ
I was wondering if anyone knew how to change the default error pages in tomcat4, run from defaultservlet.
Primarily I would like to implement custom http status 404 pages, but I would also like to run 1 custom error page for all HTTP errors.
I am running Tomcat 4.04 standalone on a Solaris 8 box.
Any advice appreciated.
Thanks
 
Try this:

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

Note: it wouldn't work without the '/' preceding error.jsp and the parser is real picky about where in the file you place the definitions. This is after the <servlet-mapping> element.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top