在要进行出错处理的JSP的文件头中用:
<%@ page language="java" contentType="text/html;charset=gb2312" errorPage="/err.jsp"%>
在err.jsp中用
<%@ page language="java" contentType="text/html;charset=gb2312" errorPage="true"%>
就可以把err.jsp设成出错页了.

解决方案 »

  1.   


    <!--
    The error-code contains an HTTP error code, ex: 404Used in: error-page
    -->
    <!ELEMENT error-code (#PCDATA)><!--
    The error-page element contains a mapping between an error code
    or exception type to the path of a resource in the web applicationUsed in: web-app
    -->
    <!ELEMENT error-page ((error-code | exception-type), location)><!--
    The exception type contains a fully qualified class name of a
    Java exception type.Used in: error-page
    -->选自web-app_2_3.dtd ,该知道咋办了吧?
      

  2.   

    jsp中:
    <%@ page errorPage="./Error.jsp" %>
    Error.jsp
    <%@ page contentType="text/html; charset=SHIFT_JIS" %>
    <%@ page language="java" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
    <html lang="ja"><head>
    <meta http-equiv="Content-Type" content="text/html; charset=SHIFT_JIS">
    <meta name="Author" content="(株) API">
    <title>errortitle>
    </head><body>
    error</body></html>
      

  3.   

    好人作到底
    web.xml里:
    <error-page>
    <error-code>404</error-code>
    <location>/error.html</location>
    </error-page>404error转到error.html上了
      

  4.   

    谢谢,还有点问题,这error-page元素在web-app元素中有什么顺序?
    我在前面加了:
    <taglib>
         <taglib-uri>/WEB-INF/FirstTag.tld</taglib-uri>
         <taglib-location>/WEB-INF/FirstTag.tld</taglib-location>
       </taglib>
    等其他标签就有问题了。不加的话是可以了
    或者你告诉我那dtd文件在哪可以找到?
      

  5.   

    http://java.sun.com/dtd/web-app_2_3.dtd