0

I have a JSF 1.1 web application, where I use ssl for lets say all pages. So when I try to download file with Internet Explorer 8, the classic security exception is raised, that I cannot download the file.

so I added to all responses with a Listener the headers suggested here: IE cannot download foo.jsf. IE was not able to open this internet site. The requested site is either unavailable or cannot be found

But it doesn't solved the problem. Then I realized that the generated html pages also contains elements:

meta content="no-cache" http-equiv="Pragma"
meta content="no-cache" http-equiv="Cache-Control"
meta content="no-store" http-equiv="Cache-Control"

So this could be the problem? How to change these for lets say all or selecte pages?

(I'm quite new in jsf)

thx

Community
  • 1
  • 1
csviri
  • 1,159
  • 3
  • 16
  • 31

1 Answers1

0

Those headers needs to be set on file download responses, not on JSF responses. A PhaseListener runs on JSF responses only (and is basically a clumsy approach for this purpose, a Filter would be better).

How and where exactly to set the headers depends on how you're serving the file download, which is not clear from the question.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Hi, I have a simple servlet for the purpose to download that file, since it is genrated. And I add these headers to servler response, but it somehow don't works. So you are saying that it enough to set it on the response for the file download request...i will play with this... – csviri Nov 21 '11 at 12:42
  • You need to set those headers in that servlet, yes. Ensure that you set them **before** you write any byte to the response. – BalusC Nov 21 '11 at 12:44