aspose file tools*
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
Author

web.xml , "error-page" tag

Gaurav Chhabras
Ranch Hand

Joined: Sep 21, 2005
Posts: 126
Hi

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-:
<web-app>
<error-page>
<error-code>500</error-code>
<location>/file_not_found.html</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/file_not_found.html</location>
</error-page>
</web-app>

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

Thanks
Regards
Gaurav
Tom E. Cole
Greenhorn

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: http://aspose.com/file-tools
 
subject: web.xml , "error-page" tag