<default-action-ref name="pagenotfound"></default-action-ref>
<action name="pagenotfound">
<result>/pagenotfound.html</result>
</action>
<error-page>
<error-code>404</error-code>
<location>/pagenotfound.html</location>
</error-page>
<error-page> <error-code>404</error-code> <location>/NotFound404.jsp</location> </error-page> <error-page> <error-code>500</error-code> <location>/NotFound500.jsp</location> </error-page>
<!-- 400错误 --> <error-page> <error-code>400</error-code> <location>/error.jsp</location> </error-page> <!-- 404 页面不存在错误 --> <error-page> <error-code>404</error-code> <location>/error.jsp</location> </error-page> <!-- 500 服务器内部错误 --> <error-page> <error-code>500</error-code> <location>/error.jsp</location> </error-page> <!-- java.lang.Exception异常错误,依据这个标记可定义多个类似错误提示 --> <error-page> <exception-type>java.lang.Exception</exception-type> <location>/error.jsp</location> </error-page> <!-- java.lang.NullPointerException异常错误,依据这个标记可定义多个类似错误提示 --> <error-page> <exception-type>java.lang.NullPointerException </exception-type> <location>/error.jsp</location> </error-page> <error-page> <exception-type>javax.servlet.ServletException</exception-type> <location>/error.jsp</location> </error-page>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> <display-name>Welcome to Tomcat</display-name> <description> Welcome to Tomcat </description> <error-page> <error-code>404</error-code> <location>/errorpages/404.jsp</location> </error-page> <error-page> <exception-type>java.lang.Exception</exception-type> <location>/errorpages/exception.jsp</location> </error-page> </web-app>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<html>
<header>
<title>404 page</title>
<body>
<pre>
<%
Enumeration<String> attributeNames = request.getAttributeNames();
while (attributeNames.hasMoreElements())
{
String attributeName = attributeNames.nextElement();
Object attribute = request.getAttribute(attributeName);
out.println("request.attribute['" + attributeName + "'] = " + attribute);
}
%>
</pre>
<%@ page contentType="text/html; charset=UTF-8" isErrorPage="true" %>
<%@ page import="java.io.*" %>
<html>
<header>
<title>exception page</title>
<body>
<hr/>
<pre>
<%
response.getWriter().println("Exception: " + exception);
if(exception != null)
{
response.getWriter().println("<pre>");
exception.printStackTrace(response.getWriter());
response.getWriter().println("</pre>");
}
response.getWriter().println("<hr/>");
%>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有