IE 无法下载 foo.jsf.IE 无法打开此 Internet 站点.请求的站点不可用或找不到 [英] IE cannot download foo.jsf. IE was not able to open this internet site. The requested site is either unavailable or cannot be found

查看:31
本文介绍了IE 无法下载 foo.jsf.IE 无法打开此 Internet 站点.请求的站点不可用或找不到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 HTTPS (SSL) 主机上的 JSF Web 应用程序中提供文件下载(通常是 CSV 或 PDF).它在大多数浏览器中都可以正常工作,只有 IE7/8 会出现以下错误:

I'm providing a file download (usually CSV or PDF) in my JSF web application on a HTTPS (SSL) host. It works fine in most browsers, only IE7/8 gives the following error:

Internet Explorer 无法下载 foo.jsf.Internet Explorer 无法打开此 Internet 站点.请求的站点不可用或找不到.请重试

Internet Explorer cannot download foo.jsf. Internet Explorer was not able to open this internet site. The requested site is either unavailable or cannot be found. Please try again

我认为该错误与 JSF <h:commandLink> 标记与 IE 不兼容有关.

I think the error is related to the JSF <h:commandLink> tag not being compatible with IE.

<h:commandLink value="Download" action="#{bean.download}" />

这是怎么引起的,我该如何解决?

How is this caused and how can I solve it?

推荐答案

这是一个典型的 MSIE 错误消息,当通过 HTTPS (SSL) 提供下载而响应标头设置为通过 无缓存.此问题与 JSF 无关.

This is a typical MSIE error message when a download is been provided over HTTPS (SSL) while the response headers are been set to disable the browser cache via no-cache. This issue is not related to JSF.

您需要放宽对浏览器缓存有影响的响应头.它不应包含 no-cache 指令.您可以将其设置为 publicprivateno-store.

You need to relax the response headers which have influence on the browser cache. It should not contain the no-cache instruction. You could set it to public, private or no-store.

response.setHeader("Cache-Control", "public");
response.setHeader("Pragma", "public");

另请参阅 MS KB Q316431.

此外,如果您碰巧在 WebSphere Application Server 上运行,那么还要添加以下标头,以防止它之后覆盖 Cache-Control 标头:

Additionally, if you happen to run on WebSphere Application Server, then add the below header as well in order to prevent it from overriding the Cache-Control header afterwards:

response.setHeader("CookiesConfigureNoCache", "false");             

另见 IE 无法通过 WebSphere 提供的 SSL 下载文件.

这篇关于IE 无法下载 foo.jsf.IE 无法打开此 Internet 站点.请求的站点不可用或找不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆