在web.xml中配置error-page
2013-09-16 11:33
369 查看
在web.xml中配置error-page
在web.xml中有两种配置error-page的方法,一是通过错误码来配置,而是通过异常的类型来配置,分别举例如下:
一. 通过错误码来配置error-page
Eg.
<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>
上面配置了当系统发生500错误(即服务器内部错误)时,跳转到错误处理页面error.jsp。
二. 通过异常的类型配置error-page
Eg.
<error-page>
<exception-type>java.lang.NullException</exception-type>
<location>/error.jsp</location>
</error-page>
上面配置了当系统发生java.lang.NullException(即空指针异常)时,跳转到错误处理页面error.jsp
在web.xml中有两种配置error-page的方法,一是通过错误码来配置,而是通过异常的类型来配置,分别举例如下:
一. 通过错误码来配置error-page
Eg.
<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>
上面配置了当系统发生500错误(即服务器内部错误)时,跳转到错误处理页面error.jsp。
二. 通过异常的类型配置error-page
Eg.
<error-page>
<exception-type>java.lang.NullException</exception-type>
<location>/error.jsp</location>
</error-page>
上面配置了当系统发生java.lang.NullException(即空指针异常)时,跳转到错误处理页面error.jsp
相关文章推荐
- 在web.xml中配置error-page
- web.xml中配置error-page
- web.xml 中配置了error-page但不起作用问题
- 在web.xml中配置error-page
- java web 在web.xml中配置error-page
- JavaEE在web.xml中实现错误页面配置(error page)
- 关于web.xml配置error-page或者springmvc添加自定义异常返回画面,画面没有显示
- 在web.xml中配置error-page
- web.xml配置error-page,IE不显示配置页面
- 在web.xml中配置error-page
- web.xml 配置了 error-page 不能跳转到指定页面
- web.xml中配置<error-page>标签不起作用的问题
- web.xml中配置<error-page>标签不起作用的问题
- 在 web.xml中配置error-page(错误重定向)
- web.xml中两种配置error-page的方法
- SSM中web.xml中配置错误页面时<error-page> ()报错
- web.xml中配置<error-page>标签
- 在tomcat的web.xml文件中配置error-page
- Jsp中errorPage使用及web.xml配置
- WEB.XML error-page 配置错误页面