We help IT Professionals succeed at work.

Redirect Internal Server Error to custom JSP page

Gangadhara Melukote
on
Can anyone please let me know how to redirect the error 500 (Internal Server Error) to custom JSP page?. I have placed below pice of code in web.xml and created Error.jsp. But still the error is not redirecting to this custom Error.jsp.

<error-page>    
     <error-code>500</error-code>    
     <location>/Error.jsp</location>    
</error-page>
Comment
Watch Question


You can give an 'error page directive' in your jsp

<%@ page errorPage="error_page.jsp" %>

http://www.coderanch.com/t/294233/JSP/java/error-page-web-xml
http://www.roseindia.net/jsp/custom-error-page.shtml
Top Expert 2007
Commented:
That is the correct way to configure a custom error page in Tomcat.  However, not all errors in the Web server will be caught.

Post an example of an error which is not redirected to the /Error.jsp .