Tomcat Incompatibility with IE6/Adobe Reader 6.0.1

C

Craig

Problem:

We want to develop a JSP which will be a generic file downloader,
handling Word, Excel, PDF, etc. When we try to display a PDF file via
JSP code from Tomcat, IE launches the Adobe Acrobat Reader 6 Plugin
(splash pages are displayed...), but then just a blank page is
displayed and the IE status says "Done". No error message is
displayed. No error is generated in the System Event logs. The PDF
should have been displayed in the IE browser window.


Client Environment:

- Windows XP or Windows 2000
- Adobe Reader 6.0.1 (occurs with 6.0.2 patch as well)
- Reader is set to open PDFs in the browser window
- IE 6.0.2800 (and 6.0.2900 XP sp2 patch)


Server Environment (Windows XP and Sun Solaris 8 tested)

- Tomcat 4.0.6/JDK 1.3.1 (no separate web server)
- Tomcat 4.1.31/JDK 1.4.2 (ditto)
- Tomcat 5.5.4/JDK 1.5.0 (ditto)
- No firewall
- No SSL is being used at this point (but it will eventually)
- No compression (no filters, etc.)

[On all Tomcat instances, confirmed the mime type for PDF exists and is
correct.]


Additional Information:

1) Our URLs are formed like this:

http://app.ourserver.com/appname/docViewPDF.jsp

2) Our app is issuing HTTP GETs, not POSTs.

3) This is happening on multiple PCs. One thing we noticed is this may
be Reader version dependent -- all PCs with Reader 5 installed did not
have the problem, but all PCs with Reader 6 have the problem.

4) When the problem occurs, if you then launch Reader manually, the
document that didn't display in the IE window is automatically
displayed in the full client Reader app.!!!

5) If we set Reader to not open up PDFs in browser windows, the Reader
window launches and opens the PDF file just fine. [This is a client
solution, and not practical to implement across hundreds of PCs
unfortunately.]


The Cause:

If we look at the .java file Tomcat produces from our source, we notice
Tomcat is adding "charset=ISO-8859-1" to the Content-Type header in the
response. You can see this in the HTTP response header

GET /wijsp/docViewAGN.jsp HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-excel, application/vnd.ms-powerpoint,
application/msword, application/x-shockwave-flash, */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET
CLR 1.1.4322)
Host: localhost:8080
Connection: Keep-Alive
Cookie: JSESSIONID=FC28B3020472C34A53807A8A8AA4CCD6; BPIimage=5

HTTP/1.1 200 OK
Content-Type: application/pdf;charset=ISO-8859-1 [<---- added by
Tomcat]
Content-Length: 589962
Content-disposition: inline; filename="Example.pdf"
Date: Thu, 09 Dec 2004 22:21:20 GMT
Server: Apache Tomcat/4.0.6 (HTTP/1.1 Connector)

There's no way to surpress it that we can find. If we rewrite the JSP
as a servlet and leave off the charset parameter, the problem goes
away.

We believe Tomcat isn't doing anything wrong -- IE6/Reader 6 just
done't seem to handle it properly. It appears this is a new bug in
Reader 6, and all our PCs with Reader 5 still installed work fine in
this situation.

Can anyone confirm?
 
M

mshubat

Hi Craig,

I've just been hit with this same problem with the incompatbility
between IE6/Reader 6 when streaming pdf documents to the browser (also
a generic file downloader). We are working in the IIS/.NET
environment. ASP.NET seems to be adding charset=utf-8 to the end of
the content-type.

did you find any resolution?
 
C

Craig

Yes, I had to rewrite the JSPs as servlets (not too hard since you can
get to the .java files the compile creates from the JSP files). I just
removed the charset parm wherever it existed, and the problem went
away.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top