Custom HTTP error page is not displayed in Internet Explorer

前端 未结 2 1793
-上瘾入骨i
-上瘾入骨i 2020-12-01 14:55

I am using Tomcat 7 and JSP pages. I would like to provide a custom error page for HTTP 500 errors.

What I did is to declare the custom error page as following in

相关标签:
2条回答
  • 2020-12-01 15:36

    This is an IE feature. When an HTTP error page retrieved from the server is smaller than 512 bytes, then IE will by default show a "Friendly" error page like the one you're facing, which is configureable by Tools > Internet Options > Advanced > Uncheck "Show Friendly Error Message" in the browser. Other (real) browsers does not have this feature.

    Making your HTTP error page a little larger than 512 bytes should workaround this IE feature. You could add some extra meta headers, add some whitespace to indent code, add some more semantic markup following your site's standard layout, add a large HTML comment, etc.

    0 讨论(0)
  • 2020-12-01 15:48

    Found that adding

    <% response.setStatus(200); %>
    

    to the error JSP page (i.e. before HTML tag) would fix the issue.

    0 讨论(0)
提交回复
热议问题