We help IT Professionals succeed at work.

Redirect Internal Server Error to custom JSP page

Gangadhara Melukote
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.

Watch Question

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

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

Top Expert 2007
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 .