错误处理页面的制作404,和500
来源:互联网 发布:淘宝比较没竞争的类目 编辑:程序博客网 时间:2024/05/31 06:22
web.xml文件增加如下代码
<error-page>
<error-code>404</error-code>
<location>/building.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/building.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>building.jsp
<%@ page language="java" contentType="text/html; charset=GBK" isErrorPage="true" pageEncoding="GBK"%>
<%
response.setStatus(HttpServletResponse.SC_OK);
%>
对不起,您请求的页面没有找到!
<%@ page language="java" contentType="text/html; charset=GBK" isErrorPage="true" pageEncoding="GBK"%>
<%
response.setStatus(HttpServletResponse.SC_OK);
%>
对不起,您请求的页面没有找到!error.jsp
<%@ page language="java" contentType="text/html; charset=GBK" isErrorPage="true" pageEncoding="GBK"%>
<%@ page import="java.io.*,java.util.*"%>
<%response.setStatus(HttpServletResponse.SC_OK);
%>
<body>
程序发生了错误,有可能该页面正在调试或者是设计上的缺陷.
你可以选择
<a href=<%=request.getContextPath()+"/forum/new.jsp" %>>反馈</a>
提醒我... 或者
<a href="javascript:history.go(-1)">返回上一页</a>
<hr width=80%>
<h2><font color=#DB1260>JSP Error Page</font></h2>
<p>An exception was thrown: <b> <%=exception.getClass()%>:<%=exception.getMessage()%></b></p>
<%
System.out.println("Header....");
Enumeration<String> e = request.getHeaderNames();
String key;
while(e.hasMoreElements()){
key = e.nextElement();
System.out.println(key+"="+request.getHeader(key));
}
System.out.println("Attribute....");
e = request.getAttributeNames();
while(e.hasMoreElements()){
key = e.nextElement();
System.out.println(key+"="+request.getAttribute(key));
}
System.out.println("arameter....");
e = request.getParameterNames();
while(e.hasMoreElements()){
key = e.nextElement();
System.out.println(key+"="+request.getParameter(key));
}
%>
111<%=request.getAttribute("javax.servlet.forward.request_uri") %>
<%=request.getAttribute("javax.servlet.forward.servlet_path") %>
<p>With the following stack trace:</p>
<pre>
<%exception.printStackTrace();
ByteArrayOutputStream ostr = new ByteArrayOutputStream();
exception.printStackTrace(new PrintStream(ostr));
out.print(ostr);
%>
</pre>
<hr width=80%>
</body>
- 错误处理页面的制作404,和500
- 错误处理页面的制作404,和500
- 处理404错误页面
- 404错误页面处理
- Springboot 404 500错误页面处理
- 用php制作友好的404错误页面
- jsp的错误处理页面
- JSP页面的错误处理
- jsp错误页面的处理
- dedecms制作404错误页面方法
- 404和500错误页面的编码的含义
- 美丽的错误:26个创意的404错误页面制作示例
- 404错误、500错误、异常错误提示页面的拦截和自定义
- web.xml 配置404和500错误的自定义页面
- web.xml 配置404和500错误的自定义页面
- web.xml 配置404和500错误的自定义页面
- web.xml 配置404和500错误的自定义页面
- web.xml 配置404和500错误的自定义页面
- vc_study_9
- 一个人久了
- Socket群聊
- 技术-寂寞
- 程序员的情书
- 错误处理页面的制作404,和500
- exe关联文件
- 努力
- OpenSSL简介
- 4月2日下决心
- C++之开始
- C++之开始
- 初识学习大本营
- 资源评价