500.jsp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <%@ page contentType="text/html; charset=utf-8"%>
  2. <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
  4. <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
  5. <%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
  6. <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
  7. <c:set var="basePath" value="${pageContext.request.contextPath}"/>
  8. <!DOCTYPE html>
  9. <html>
  10. <head>
  11. <meta charset="utf-8"/>
  12. <title><spring:message code="500"/></title>
  13. </head>
  14. <body>
  15. <center style="margin:50px auto">
  16. <p>错误代码:500<%//=request.getAttribute("javax.servlet.error.status_code")%></p>
  17. <p>您访问的页面有错误!</p>
  18. <p>错误原因:${error.message}</p>
  19. <p>错误内容:${error}</p>
  20. <p><!--页面将在<span id="stime">5</span>秒后-->跳转到<a href="${pageContext.request.contextPath}/">首页</a>!</p>
  21. </center>
  22. <%
  23. /**
  24. 监控出错人的IP
  25. String ip = request.getHeader(" x-forwarded-for");
  26. if (ip == null || ip.length() == 0 || " unknown".equalsIgnoreCase(ip)) {
  27. ip = request.getHeader(" Proxy-Client-IP"); // 获取代理ip
  28. }
  29. if (ip == null || ip.length() == 0 || " unknown".equalsIgnoreCase(ip)) {
  30. ip = request.getHeader(" WL-Proxy-Client-IP"); // 获取代理ip
  31. }
  32. if (ip == null || ip.length() == 0 || " unknown".equalsIgnoreCase(ip)) {
  33. ip = request.getRemoteAddr(); // 获取真实ip
  34. }
  35. //out.println(ip+"<br/><br/>你的地址是:<br/><br/>");
  36. Document doc = Jsoup.connect("http://ip.chinaz.com/?IP="+ip).timeout(9000).get();
  37. Element e = doc.select("#status").first();
  38. //out.println(e);
  39. */
  40. %>
  41. </body>
  42. </html>