Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tomcat <-> Acrobat Plugin for Internet Explorer problem

Status
Not open for further replies.

breidle3

Programmer
Jun 27, 2005
8
AT
I have Cocoon 2.0.2 running on Tomcat 5.5.9 generating PDF content which has to be returned to the MS Internet
Explorer 6.0 and which should be displayed using the Acrobat Reader 6.0 plug-in for MS IE. But instead of opening the returned content in the Acrobat plug-in, I get a file download popup which ask for opening or saving
the file (file type "Adobe Acrobat Control for ActiveX").

Btw, the same procedure works fine when
* running Cocoon on WebSphere Application Server in
combination with MS IE 6.0
* running Cocoon on Tomcat in combination with
a Netscape browser 8.0.

I figured out that in Tomcat, if the ContentType is set, a charset is automatically appended to it
(default ISO-8859-1). Obviously, this charset value cannot be handled correctly by Acrobat's IE plug-in.

I think this is rather a problem of Adobe's plug-in
implementation than Tomcat's problem since in the Java Servlet Specification 2.4 is stated that servlets must include a charset.

Does anybody have an idea how to solve the problem ?
Thanks a lot for your help !
Klaus
 
set the Content-Type header for the response as "application/pdf" .

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Thank you for your immediate response!
Where can I set the Content-Type header to application/pdf?
Is there a possibility in server.xml or web.xml of Tomcat? I just call Cocoon using this URL:



There, I can only specify the output type PDF "...&_ot=pdf&....".
Nevertheless, running on WebSphere, the result has
application/pdf in the content-header. Running on
Tomcat, Tomcat appends "charset=ISO-8859-1" automatically.
So, the Content-type looks like that:
Content-type: application/pdf;charset=ISO-8859-1

Because of this charset entry, the plugin does not
work correctly. So my question is, how do I have to
do to disable this automatic appending of the charset?

Thanks a lot !
 
I normally set the Content-Type header like this :

response.setContentType("application/pdf")

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Ok, if you have your own JSPs or servlets you can do it
like that. But in my case, Cocoon is running as a servlet
on Tomcat. Do I have an understanding problem or does that mean that I have to "bugfix" the Cocoon servlet, inserting the statement suggested above, to get it working ?
Actually, Cocoon is returning application/pdf as content type and Tomcat is attaching the ISO-8859-1 value
automatically afterwards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top