The Artima Developer Community
Sponsored Link

Java Buzz Forum
How IE handles PDFs

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Matt Raible

Posts: 422
Nickname: mraible
Registered: Jul, 2003

Matt Raible is a J2EE Consultant in Denver, Colorado.
How IE handles PDFs Posted: Mar 23, 2005 10:33 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Matt Raible.
Original Post: How IE handles PDFs
Feed Title: Raible Designs ~ We Build Web Apps
Feed URL: http://static.raibledesigns.com/500.html
Feed Description: Opinions and tips on how to build web applications using Java. Currently using Hibernate, Struts, XHTML, CSS, Ant, JUnit and XDoclet.
Latest Java Buzz Posts
Latest Java Buzz Posts by Matt Raible
Latest Posts From Raible Designs ~ We Build Web Apps

Advertisement
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.

Read: How IE handles PDFs

Topic: Trust and Robust Previous Topic   Next Topic Topic: NoFollow Coverage

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use