我正在使用 Tomcat 7 和 JSP 页面。我想为 HTTP 500 错误提供一个自定义错误页面。
我所做的是在如下声明自定义错误页面web.xml
:
<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>
我创建了一个error.jsp
使用以下代码调用的 JSP:
<%@ page pageEncoding="UTF-8" isErrorPage="true" %>
<!DOCTYPE html>
<html>
<head>
<title>500</title>
</head>
<body>
<img src="${pageContext.request.contextPath}/images/500.jpg" />
</body>
</html>
现在这适用于大多数浏览器,但在 Internet Explorer 中,我被带到标准的“网站无法显示页面”页面。
为什么我的自定义 HTTP 500 错误页面未在 Internet Explorer 中显示?