在web开发中往往会遇到服务器错误或路径请求有误这时候会出现很不友好的页面要想出现自己设置的提示则
在web.xml文件下配置:
<!-- 页面不存在 -->
<error-page>
<error-code>404</error-code>
<location>/pagenotfound.html</location>
</error-page>
<error-page>
<error-code>505</error-code>
<location>/requesterror.html</location>
</error-page>
<!-- 错误页面 -->
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.html</location>
</error-page>

被折叠的 条评论
为什么被折叠?



