内容简介:使您的HTTP错误页面大于512字节应解决此IE功能.您可以添加一些额外的元标题,在缩进代码中添加一些空格,在网站的标准布局后添加更多语义标记,添加大量HTML注释等.翻译自:https://stackoverflow.com/questions/9022932/custom-http-error-page-is-not-displayed-in-internet-explorer
我正在使用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中显示?
使您的HTTP错误页面大于512字节应解决此IE功能.您可以添加一些额外的元标题,在缩进代码中添加一些空格,在网站的标准布局后添加更多语义标记,添加大量HTML注释等.
翻译自:https://stackoverflow.com/questions/9022932/custom-http-error-page-is-not-displayed-in-internet-explorer
以上所述就是小编给大家介绍的《jsp – Internet Explorer中不显示自定义HTTP错误页面》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:- 自定义错误上报的奇怪问题
- 教你如何自定义Flutter错误页面
- Django 自定义 404 500 等错误页面
- knockout.js – 自定义错误消息和位置
- sql-server-2005 – 如何在SSIS包中创建错误日志或自定义错误日志?
- ES5 / ES6 自定义错误类型比较
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Algorithms on Strings, Trees and Sequences
Dan Gusfield / Cambridge University Press / 1997-5-28 / USD 99.99
String algorithms are a traditional area of study in computer science. In recent years their importance has grown dramatically with the huge increase of electronically stored text and of molecular seq......一起来看看 《Algorithms on Strings, Trees and Sequences》 这本书的介绍吧!