This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JSP and the fly likes Handle all error codes other than one Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply 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: 66
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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Handle all error codes other than one
 
Similar Threads
response.setStatus
handle exception in servlet
Displaying a Default Error page
Handling multiple error code through one entry in web.xml
tomcat 5 and error page