web.xml配置404,500出错页面

<!-- 400错误 -->
<error-page>
<error-code>400</error-code>
<location>/errorPage.jsp</location>
</error-page>
<!-- 404 页面不存在错误 -->
<error-page>
<error-code>404</error-code>
<location>/errorPage.jsp</location>
</error-page>
<!-- 500 服务器内部错误 -->
<error-page>
<error-code>500</error-code>
<location>/errorPage.jsp</location>
</error-page>
<!-- java.lang.Exception异常错误,依据这个标记可定义多个类似错误提示 -->
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/errorPage.jsp</location>
</error-page>
<!-- java.lang.NullPointerException异常错误,依据这个标记可定义多个类似错误提示 -->
<error-page>
<exception-type>java.lang.NullPointerException </exception-type>
<location>/errorPage.jsp</location>
</error-page>

<error-page>
<exception-type>javax.servlet.ServletException</exception-type>
<location>/errorPage.jsp</location>
</error-page>


文章出处:飞诺网(www.firnow.com):http://dev.firnow.com/course/3_program/java/javajs/20100719/459764.html

posted @ 2010-12-18 14:47  七郎  Views(971)  Comments(0Edit  收藏  举报