File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes custom 404 error page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "custom 404 error page" Watch "custom 404 error page" New topic
Author

custom 404 error page

Don Arnett
Greenhorn

Joined: Feb 05, 2001
Posts: 18
Our system uses apache and tomcat on linux boxes. Does anyone know how to configure tomcat to use a custom 404 error page? I can get a custom page (via apache) when someone enters a bad .html URL, but would like to have a custom page for when someone enters a bad .jsp URL.
THanks
Don Arnett
Greenhorn

Joined: Feb 05, 2001
Posts: 18
fingered it out. In the WEB-INF/web.xml file for each context, add the following
<error-page>
<error-code>
404
</error-code>
<location>
/jsp/errorPage404.jsp
</location>
</error-page>

the file entry (/jsp/errorPage404.jsp) must start with a / and is relative to the context home directory.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: custom 404 error page
 
Similar Threads
Custom 404
custom 404 and 500 error pages in was 6.0
How to customize the 404 error page for Tomcat
Regarding error in index.jsp page
Sometimes give 404 not found error