Wednesday March 23, 2005
How IE handles PDFs From the Struts User Mailing List, I spotted a good explanation of how IE handles PDFs. It's quite messed up, so I thought I'd post it for your amusement.
If
your application returns data that is to be handled with an ActiveX
control (ie Adobe Acrobat Reader) the browser sends additional
requests to the server. In IE 4.x and 5 it actually sends three
requests. For IE 5.5+ it sends two.
Assuming that your using IE 5.5+, the first request is the original
request (duh), but then IE sends a second request to get the
content-type. Who knows why they can't figure this out on the first
request
This second request has it's userAgent header set to
"contype". You can solve this problem and increase the performance of
your application by writing a Servlet filter that sits in front of
whatever Actions you have setup to serve PDF content. Have this
filter look at the userAgent header of each request. If it's set to
"contype" just send an an empty response back to the client with the
content type set to "application/pdf". Simple as that.
More info on this "feature" is on Microsoft's site. Posted in Java at Mar 23 2005, 09:29:56 PM MST 2 Comments
Search This Site
Recent Entries
- EhCache Project Busy this Summer
- Spontaneous Stuff Weekend
- Awesome Birthday Present: A Kegerator
- Maven Plugin for Running Integration Tests against Multiple Containers
- Presenting Web Frameworks of the Future Tomorrow in Denver
- My OSCON Aftermath
- OSCON 2008 Wrapup
- [OSCON 2008] Even Faster Web Sites by Steve Souders
- [OSCON 2008] CSS for High Performance JavaScript UI by Gavin Doughtie
- [OSCON 2008] The State of Lightning Talks
Posted by David Carter on March 24, 2005 at 05:41 AM MST #
Posted by Keller on March 25, 2005 at 05:26 PM MST #