File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

web.xml , "error-page" tag

 
Gaurav Chhabras
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic