JSP配置错误页面

来源:互联网 发布:域名绑定多个ip 编辑:程序博客网 时间:2024/04/28 22:29

Index.jsp页面:<%@ page  errorPage="ErrorPage.jsp"%>

 

ErrorPage.jsp:<%@ page  isErrorPage="true"%>

 

或者在web.xml中配置:

<error-page>
   <error-code>404</error-code>
   <location>/ErrorPage.jsp</location>
  </error-page>
  <!--<error-page> 
   <exception-type>java.lang.ClassNotFoundException</exception-type> 
   <location>/ErrorPage.jsp</location> 
 </error-page>-->

 

配置错误页面时纠结了半天:如果ErrorPage.jsp大小不超过1024字节时,上述操作都无法跳转到错误页面.

原创粉丝点击