http_error.jsp

来自「java大型企业DRP系统源码带sql数据库」· JSP 代码 · 共 43 行

JSP
43
字号
<%@ page language="java" contentType="text/html; charset=GB18030"
    pageEncoding="GB18030"%>
<html>
<head>
<title>自定义的错误页</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
</head>
<body marginwidth="0" leftmargin="0" bgcolor="ffffff">

<table width="90%">
  <tbody>
    <tr>
      <td width="98%">
          自定义的错误页
      <hr>      </td>
    </tr>
    <tr>
      <td></td>
    </tr>
    <tr>
      <td>
<% 
      int status_code = -1;
      String exception_info = null;
      Exception theException = null;
      status_code = ((Integer) request.getAttribute("javax.servlet.error.status_code"));
      exception_info = (String) request.getAttribute("javax.servlet.error.message");
      theException = (Exception) request.getAttribute("javax.servlet.error.exception_type");
      if(status_code==404)        
        response.sendRedirect("404.jsp");
      if(status_code==500)                        
        response.sendRedirect("500.jsp");
      out.println("<br><b>StatusCode:</b> " +  status_code);
      out.println("<br><b>Exception:</b>" + exception_info);

%>     </TD>
    </TR>
  </TBODY>
</TABLE>

</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?