You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Chris Lott <ma...@invest-faq.com> on 2006/02/24 22:33:40 UTC

Problem with getting ppt file from tomcat JSP server via https/SSL

Hi,

Summary: Please tell me what headers Tomcat sets when it serves out a 
plain file, and how I can control those headers.

Long version:

I'm using Tomcat 5.0.28 for a small webapp.  It sits behind Apache,
which does SSL and forwards requests to Tomcat via mod_jk.

Anyhow, in the documentation area for my webapp users I tossed a few
HTML files and power-point files, and added links on JSP pages right to
those files.  Clicking on the links to the HTML works fine, the tomcat
server pushes them across wonderfully.  The problems arise when an IE
user clicks on a link to a powerpoint file.  (It works fine in Firefox.)

I first had to extend web.xml for the appropriate mime-type.  This is
documented partly in Tomcat bugzilla bug # 27617 (and I'm trying to get
that reopened).  That change got me one step farther, but there are
still problems.

It appears that IE 6 is very sensitive to Cache-Control headers.  Here
are some links that get into the problem:

http://support.microsoft.com/default.aspx?scid=kb;en-us;812935

http://forum.java.sun.com/thread.jspa?threadID=233446&start=0&tstart=0

http://www.alexking.org/blog/2004/11/03/workaround-for-iessl-problem

The workarounds suggested by the sites above focus on removing or
altering the Pragma and Cache-Control headers.  I'd like to do that, but
cannot find anything about doing that on a default basis.  Sure, I can
set/remove headers on a JSP response object, but in the case of a simple
file, I'm not coding a JSP page nor manipulating any response object.

Finally my questions: I believe that Tomcat sets headers when it shovels
out a file.  Is that right?  If so, how can I control what headers are set?

I suspect the workaround may be do put a little JSP page in place that
adjusts the headers and somehow dumps out the content of the file, but
ugh, I'm don't like the sound of all that complexity.

Please reply (cc me directly if you don't mind), thanks in advance!

chris...

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Problem with getting ppt file from tomcat JSP server via https/SSL

Posted by Chris Lott <ma...@invest-faq.com>.
Chris Lott wrote:
> Hi,
> 
> Summary: Please tell me what headers Tomcat 5.0.28 sets when it serves out a 
> plain file, and how I can control those headers.
>..

I found more detail and found a possible solution.  I still welcome your 
comments.

To figure out what headers Tomcat sets in responses, I turned on the 
RequestDumperValve in the server.xml file.  There I saw that every 
single request -- whether .gif, .html, .css, .ppt, or .jsp -- gets 
"Cache-Control: no-cache" and "Pragma: no cache" in the response 
headers.  So that answers my first question.  (And the Apache sitting in 
front of Tomcat seems to have no influence here whatsoever.)

A possible solution came from here:
http://www.jspinsider.com/content/dev/afessh/another-filter-every-site-should-have.html
where Jayson Falkner discusses using servlet filters to set response 
headers so web browsers will cache items like pictures and other static 
content.  I used this approach with some success.

I still have one question and/or a suggestion: it seems that Tomcat 
needs some configuration setting so users like me can tell the container 
what caching policy to apply by default.   Maybe it exists, but I have 
not found it.  Possibly an enhancement, sort of like a mime-types file, 
would allow the caching policy to be set based on file suffixes or 
file-name patterns.

Thanks for listening, and I would sure appreciate guidance if I'm all 
wet here, or confirmation that I'm on the right path.

chris...

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org