How to change HTTP headers to static files served by JBoss

I have a web application (.war) that contains some static files (like MS text documents). When I try to download these files, JBoss automatically sets some HTTP headers in the response. Is there a way to tune JBoss (version 3.2.7) to set these headers to specific values ​​(or omit them)? I'm especially interested in

Cache-Control: no cache

      

because it leads to some problems when uploading files over https using Internet Explorer (IE will refuse to save the file to disk).

Btw. this behavior can be changed by adding an entry to the Windows Registry:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"BypassSSLNoCacheCheck"=dword:00000001

      

but obviously I'm not going to ask clients to mess with their registry just to download the file.

Any suggestions are greatly appreciated.

+1


source to share


2 answers


Here's a description of the JBoss community wiki on how to disable the Cache-Control behavior.



I didn't know about this IE6 feature until now. Does this also apply to IE7?

+4


source


An option that comes to mind is to wrap a servlet (or similar) around it - so that the url that gets called calls your servlet, which then sets the headers you want and then provides the underlying document.



0


source







All Articles