JSP Error handler : Errors « JSP « Java






JSP Error handler

<%@page isErrorPage="true" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<html>
<head><title>Sorry about the error</title></head>
<body>
<h2>Sorry, We Erred Handling Your Request</h2>
<strong>Here is information about the error:</strong> <br><br>

The servlet name associated with throwing the exception: 
<%-- JSP 2.0 usage only! 
<c:out value="${pageContext.errorData.servletName}" />  --%>
<br><br>
The type of exception: <c:out value=
  "${requestScope[
   \"javax.servlet.jsp.jspException\"].class.name}" />
<br><br>
The request URI:
<%-- JSP 2.0 usage only! 
<c:out value="${pageContext.errorData.requestURI}" />  --%>
<br><br>
The exception message: 
  <c:out value="${pageContext.exception.message}" />
 </body>
</html>



           
       








Related examples in the same category

1.Simple error testing
2.Jsp Error Bean
3.Using an Error Page Jsp
4.Using the Exception Object in Jsp
5.Building a simple error handling page
6.Deal with the errors
7.Error without handler
8.Error Handling: compile error in JSP page
9.JSP error: no such page
10.Page with error in JSP directive and actions
11.JSP error detected
12.Advanced Dynamic Web Content Generation: form error checkAdvanced Dynamic Web Content Generation: form error check