• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 588
  • Last Modified:

Redirect Internal Server Error to custom JSP page

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>
0
Gangadhara Melukote
Asked:
Gangadhara Melukote
  • 2
3 Solutions
 
chaitu chaituCommented:

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
0
 
mrcoffee365Commented:
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 .
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now