File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes web.xml , Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "web.xml , "error-page" tag" Watch "web.xml , "error-page" tag" New topic

web.xml , "error-page" tag

Gaurav Chhabras
Ranch Hand

Joined: Sep 21, 2005
Posts: 126

I like to do that if my application will receive an error like 400 ( page not found ) then it will not show the error page provided by tomcat , i want that if that type of error comes then my error page will come.

In web.xml i have used-:

But after that it is not forwarding to my page.
Please rectify me.

Tom E. Cole

Joined: Oct 21, 2003
Posts: 9
Is this all there is to your web.xml? If not, you need to make sure that you've got the error-code section defined in the correct place (which depends on the file version you're using, but who would know because you didn't specify it in your web-app tag....)

Other than that, the error-code section you've posted is fine, given that there is a file_not_found.html file in the root directory of your webapp.
Here is my error-code section to my web.xml and it works exactly as expected:

I agree. Here's the link:
subject: web.xml , "error-page" tag
It's not a secret anymore!