%@ page isErrorPage="true"%>
<%@ taglib uri="tags-lams" prefix="lams"%>
<%@ taglib uri="tags-core" prefix="c"%>
<%@ taglib uri="tags-fmt" prefix="fmt"%>
<%@ page import="org.lamsfoundation.lams.util.Configuration" import="org.lamsfoundation.lams.util.ConfigurationKeys" %>
<%-- Catch JSP Servlet Exception --%>
<%-- The javascript method checkForErrorScreen in error.js is coded to match this page exactly.
---- If you change this page, please change the javascript. --%>
<%
if ( Configuration.getAsBoolean(ConfigurationKeys.ERROR_STACK_TRACE) ) {
if (exception != null ) {
%>
<%=exception.getMessage()%>
<%=exception.getClass().getName()%>
<%
java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream();
java.io.PrintStream os = new java.io.PrintStream(bos);
exception.printStackTrace(os);
String stack = new String(bos.toByteArray());
%>
<%=stack%>
<%
} else if ((Exception) request.getAttribute("javax.servlet.error.exception") != null) {
%>
<%=((Exception) request.getAttribute("javax.servlet.error.exception")).getMessage()%>
<%=((Exception) request.getAttribute("javax.servlet.error.exception")).getMessage()
.getClass().getName()%>
<%
java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream();
java.io.PrintStream os = new java.io.PrintStream(bos);
((Exception) request.getAttribute("javax.servlet.error.exception")).printStackTrace(os);
String stack = new String(bos.toByteArray());
%>
<%=stack%>
<%
}
}
%>