500.jsp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <%@page import="java.io.PrintWriter"%>
  4. <%@page import="java.io.StringWriter"%><html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7. <title>错误500</title>
  8. <style type="text/css">
  9. a:link,a:active,a:visited {
  10. color: blue, text-decoration : underline
  11. }
  12. a:hover {
  13. color: red;
  14. text-decoration: none
  15. }
  16. </style>
  17. </head>
  18. <body style="margin: 200px 0px 0px 0px">
  19. <div align="center">
  20. <img align="absmiddle"
  21. src="<%=request.getContextPath()%>/resource/images/logo_gray1.gif"
  22. border="0" />
  23. </div>
  24. <div align="center"
  25. style="font-weight: bold; color: red; padding: 40px">
  26. 提示您:服务器发生内部错误!
  27. </div>
  28. <div align="center" style="font-size: 10pt">
  29. 您可以选择:
  30. <a href="javascript:location.reload()">刷新</a>&nbsp;&nbsp;&nbsp;
  31. <a href="javascript:history.back()">返回</a>
  32. </div>
  33. <div style="padding: 30px">
  34. <%
  35. if (request.getRemoteAddr().equals(request.getLocalAddr())) {
  36. Exception ex = (Exception) request
  37. .getAttribute("javax.servlet.error.exception");
  38. if (ex != null) {
  39. pageContext
  40. .getServletContext()
  41. .log(
  42. new StringBuilder().append("IP:").append(
  43. request.getRemoteAddr()).append(
  44. ",Path:").append(request.getRequestURI()).toString(), ex);
  45. %>
  46. <hr />
  47. <h3>
  48. 错误信息:
  49. </h3>
  50. <p>
  51. <%=ex.getMessage()%>
  52. </p>
  53. <hr />
  54. <h3>
  55. 错误堆栈:
  56. </h3>
  57. <p>
  58. <%
  59. StringWriter sw = new StringWriter();
  60. ex.printStackTrace(new PrintWriter(sw));
  61. sw.close();
  62. out.println(sw.toString().replace("\n", "<br/>"));
  63. %>
  64. </p>
  65. <%
  66. }
  67. }
  68. %>
  69. </div>
  70. </body>
  71. </html>