作者:ssslinppp
在遇到404错误时,如何跳转到404界面?下面将介绍之。
404.jsp


在web.xml中定义

<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/500.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/500.jsp</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/404.jsp</location>
</error-page>
测试

参考链接: