error-page.jsp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <%@ page extends="hello.GhJsp" %><%@ include file="/WEB-INF/jsp/include-variables.jsp" %><%
  2. // -----------------------------------------------------------------
  3. // Error page
  4. //
  5. // author: mhixson
  6. //
  7. // The error page is rendered when the controller tier encounters
  8. // an uncaught exception during its request processing. The
  9. // exception is delivered along with an optional description.
  10. // -----------------------------------------------------------------
  11. vars.title = "GeminiHello Error";
  12. Throwable exception = (Throwable)context.getDelivery("Exception");
  13. String description = context.getStringDelivery("Description");
  14. boolean reveal = context.getBooleanDelivery("RevealStackTrace");
  15. // If reveal is false, the stack trace will be rendered into an HTML
  16. // comment. Application authors should consider removing that entirely
  17. // if they are worried about users being able to find the stack trace.
  18. %><%@ include file="/WEB-INF/jsp/include-page-start.jsp" %>
  19. <h2>Sorry, your request could not be processed due to an error</h2>
  20. <p>
  21. The request you submitted resulted in an error. Your request cannot be processed at this time. Please notify the system administrator.
  22. </p>
  23. <%= reveal ? "<p><pre style=\"color: #508050\">" : "<!--" %>
  24. Exception:
  25. <%= ThrowableHelper.getStackTrace(exception) %>
  26. <%
  27. if (exception instanceof ServletException)
  28. {
  29. ServletException servletException = (ServletException)exception;
  30. %>
  31. Root cause:
  32. <%= ThrowableHelper.getStackTrace(servletException) %><%
  33. } %>
  34. <%= reveal ? "</pre></p>" : "-->" %>
  35. <p>
  36. <%= description %>
  37. </p>
  38. <%@ include file="/WEB-INF/jsp/include-page-end.jsp" %>