error.jsp 3 KB
Newer Older
CED SA's avatar
CED SA committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
<%@ page isErrorPage="true" %>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ taglib prefix="wp" uri="aps-core.tld" %>
<%
    Object statusCode = request.getAttribute("javax.servlet.error.status_code"); 
    Object exceptionType = request.getAttribute("javax.servlet.error.exception_type"); 
    Object message = request.getAttribute("javax.servlet.error.message"); 
%>
<wp:contentNegotiation mimeType="application/xhtml+xml" charset="utf-8"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it">
<head>
	<title>jAPS 2.0 - Error</title>
	<link rel="stylesheet" type="text/css" href="<wp:resourceURL />administration/css/administration.css" />
	<link rel="stylesheet" type="text/css" href="<wp:resourceURL />administration/css/layout.css" />
	<!--[if lte IE 6]>
		<link rel="stylesheet" type="text/css" href="<wp:resourceURL />administration/css/layout_ie6.css" />
	<![endif]-->
</head>
<body>

<h1>jAPS 2.0 - Error</h1>
<p><a href="<%=response.encodeURL(request.getContextPath()) %>">Home</a></p>
<div class="message message_error">
<table border="1" width="100%" summary="Stack Trace">
<tr>
	<th scope="row">Status Code</th> 
	<td><%= statusCode %></td>
</tr>
<tr>
	<th scope="row">Exception Type</th> 
	<td><%= exceptionType %></td>
</tr>
<tr>
	<th scope="row">Message</th> 
	<td><%= message %></td>
</tr>
<tr>
	<th scope="row">Exception</th> 
	<td>
	    <%
		if( exception != null )
		{
		    out.print("<pre>");
		    exception.printStackTrace(new PrintWriter(out));
		    out.print("</pre>");
		}    
	    %>
	</td>
</tr>
<tr>
	<th scope="row">Root Cause</th> 
	<td>
	    <%
		if( (exception != null) && (exception instanceof ServletException) )
		{
		    Throwable cause = ((ServletException)exception).getRootCause();
		    if( cause != null )
		    {
			out.print("<pre>");
			cause.printStackTrace(new PrintWriter(out));
			out.print("</pre>");
		    }
		}            
	    %>
	</td>
</tr>
</table>
</div>

<h2>Header List</h2>
<div class="message message_error">
<table border="1" width="100%">
<tr>
 <th>Name</th>
 <th>Value</th>
</tr>
<%
String name  = "";
String value = "";

java.util.Enumeration headers = request.getHeaderNames();
while(headers.hasMoreElements())
{
 name  = (String) headers.nextElement();
 value = request.getHeader(name);
%>
<tr>
 <td><%=name%></td>
 <td><%=value%></td>
</tr>
<%
}
%>
</table>
</div>

<h2>Attribute List</h2>
<!-- "javax.servlet.jsp.jspException" for getting an Exception -->
<div class="message message_error">
<table border="1" width="100%">
<tr>
 <th>Name</th>
 <th>Value</th>
</tr>
<%
java.util.Enumeration attributes = request.getAttributeNames();
while(attributes.hasMoreElements())
{
 name  = (String) attributes.nextElement();

 if (request.getAttribute(name) == null)
 {
  value = "null";
 }
 else
 {
  value = request.getAttribute(name).toString();
 }
%>
<tr>
 <td><%=name%></td>
 <td><%=value%></td>
</tr>
<%
}
%>
</table>
</div>

</body>
</html>