wood burning stoves 2.0*
The moose likes JSP and the fly likes Handle all error codes other than one Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Handle all error codes other than one" Watch "Handle all error codes other than one" New topic
Author

Handle all error codes other than one

sudheshna Iyer
Ranch Hand

Joined: Aug 20, 2004
Posts: 71
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

Joined: Feb 08, 2009
Posts: 7
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>



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Handle all error codes other than one
 
Similar Threads
handle exception in servlet
Handling multiple error code through one entry in web.xml
response.setStatus
Displaying a Default Error page
tomcat 5 and error page