在web.xml中配置了404,但是无效
<error-page>
<error-code>404</error-code>
<location>/WEB-INF/Project/error.jsp</location>
</error-page>
百度了一下大致就下面三种方法,但是对我都失效了
- location属性中填写的错误页面是绝对路径
- 错误页面jsp的大小>1024字节
- 在错误页面jsp中添加<%@ page isErrorPage=“true”%>
后来研究了下,页面正常显示,错误页面生效了,如下:
- 在错误页面jsp中添加<%@ page isErrorPage=“true” errorPage=“error.jsp” %>