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

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

问题描述

我在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 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?

推荐答案

当通过HTTPS(SSL)提供下载时,这是一个典型的MSIE错误消息,而响应头已设置为通过<$ c $禁用浏览器缓存C>无缓存。此问题与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 指令。您可以将其设置为 public private no-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");             

另请参见

See also IE cannot download files over SSL served by WebSphere.

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

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