web.xml配置
<error-page>
<error-code>404</error-code>
<location>/404.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/500.jsp</location>
</error-page>
我的页面放在webapp下
注意点:
1.确保location属性中填写的错误页面是绝对路径
2.确保error.jsp的大小>1024字节(大部分都是因为这个)
3.确保在error.jsp页面中添加<%@ page isErrorPage="true"%>