<%@page contentType="text/html; charset=UTF-8" isErrorPage="true" import="java.io.*" %> <% String code = ""; String message = ""; String type = ""; String uri = null; Object codeObj; Object messageObj; Object typeObj; Throwable throwable; // Retrieve the three possible error attributes, some may be null codeObj = request.getAttribute("javax.servlet.error.status_code"); messageObj = request.getAttribute("javax.servlet.error.message"); typeObj = request.getAttribute("javax.servlet.error.exception_type"); throwable = (Throwable) request.getAttribute("javax.servlet.error.exception"); uri = (String) request.getAttribute("javax.servlet.error.request_uri"); if (uri == null) { uri = request.getRequestURI(); // in case there's no URI given } // Convert the attributes to string values if (codeObj != null) code = codeObj.toString(); if (messageObj != null) message = messageObj.toString(); if (typeObj != null) type = typeObj.toString(); // The error reason is either the status code or exception type String reason = (!"".equals(code) ? code : type); String stackTrace = null; if (throwable != null) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); throwable.printStackTrace(pw); pw.flush(); stackTrace = sw.toString(); throwable = throwable.getCause(); } %> <%@ taglib uri="http://activebpel.org/aetaglib" prefix="ae" %> <%-- Use UTF-8 to decode request parameters. --%> <ae:GetResource name="page_server_error" />
<% if ( "404".equals(reason) ) { %>

HTTP 404 - The requested resource was not found.

<% } %>

HTTP Error Message

Reason : <%= reason %>
Message : <%= message %>
Request URI : <%= uri %>
Date : <%= (new java.util.Date()).toString() %>

HTTP Request Information

JSP Request Method: <%= request.getMethod() %>
Request URI: <%= request.getRequestURI() %>
Request Protocol: <%= request.getProtocol() %>
Servlet path: <%= request.getServletPath() %>
Path info: <%= request.getPathInfo() %>
Query string: <%= request.getQueryString() %>
Content length: <%= request.getContentLength() %>
Content type: <%= request.getContentType() %>
Server name: <%= request.getServerName() %>
Server port: <%= request.getServerPort() %>
Remote user: <%= request.getRemoteUser() %>
Remote address: <%= request.getRemoteAddr() %>
Remote host: <%= request.getRemoteHost() %>
Authorization scheme: <%= request.getAuthType() %>
Locale: <%= request.getLocale() %>
User-Agent: <%= request.getHeader("User-Agent") %>

<% if (stackTrace != null) { %>

Exception:

<%= stackTrace %>
                   
<% } %> <% int causeCount = 0; while (throwable != null) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); throwable.printStackTrace(pw); pw.flush(); stackTrace = sw.toString(); throwable = throwable.getCause(); causeCount++; %>

Root Cause # <%= causeCount %>:

<%= stackTrace %>
                
<% } %>