File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Handle all error codes other than one

 
sudheshna Iyer
Ranch Hand
Posts: 71
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to handle 404 error and for all other error codes, I want to have a default error page.

I am using spring.

<error-page>
<error-code>404</error-code>
<location>/exception/404.htm</location>
</error-page>
<error-page>
<error-code>*</error-code> ===> This syntax is not correct. Is there any way to define this?
<location>/exception</location>
</error-page>
 
Keerthi Pandey
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You rather use this. This might help you..

<error-page>
<error-code>404</error-code>
<location>/exception/404.htm</location>
</error-page>

<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/exception</location>
</error-page>



 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic