Hi All,
We are having an issue with the latest version of Tomcat and how the Content Type header is being set by it now - in particular with PDFs generated by our application. The following is taken straight from the RequestDumperValve:
OLD (Tomcat 4.1.24) 2003-11-11 16:11:19 RequestDumperValve[Standalone]: --------------------------------------------------------------- 2003-11-11 16:11:19 RequestDumperValve[Standalone]: authType=null 2003-11-11 16:11:19 RequestDumperValve[Standalone]: contentLength=24971 2003-11-11 16:11:19 RequestDumperValve[Standalone]: contentType=application/pdf 2003-11-11 16:11:19 RequestDumperValve[Standalone]: header=Content-Type=application/pdf 2003-11-11 16:11:19 RequestDumperValve[Standalone]: header=Content-Length=24971 2003-11-11 16:11:19 RequestDumperValve[Standalone]: message=null 2003-11-11 16:11:19 RequestDumperValve[Standalone]: remoteUser=null 2003-11-11 16:11:19 RequestDumperValve[Standalone]: status=200 2003-11-11 16:11:19 RequestDumperValve[Standalone]: ===============================================================
NEW (Tomcat 4.1.29) 2003-11-11 16:07:08 RequestDumperValve[Standalone]: --------------------------------------------------------------- 2003-11-11 16:07:08 RequestDumperValve[Standalone]: authType=null 2003-11-11 16:07:08 RequestDumperValve[Standalone]: contentLength=24971 2003-11-11 16:07:08 RequestDumperValve[Standalone]: contentType=application/pdf;charset=ISO-8859-1 2003-11-11 16:07:08 RequestDumperValve[Standalone]: header=Content-Type=application/pdf;charset=ISO-8859-1 2003-11-11 16:07:08 RequestDumperValve[Standalone]: header=Content-Length=24971 2003-11-11 16:07:08 RequestDumperValve[Standalone]: header=Date=Tue, 11 Nov 2003 21:07:08 GMT 2003-11-11 16:07:08 RequestDumperValve[Standalone]: header=Server=Apache-Coyote/1.1 2003-11-11 16:07:08 RequestDumperValve[Standalone]: message=null 2003-11-11 16:07:08 RequestDumperValve[Standalone]: remoteUser=null 2003-11-11 16:07:08 RequestDumperValve[Standalone]: status=200 2003-11-11 16:07:08 RequestDumperValve[Standalone]: ===============================================================
Obviously the change is now that the charset has been appended to the
Content-Type header. This is causing a problem
with IE browsers (tested on the latest 6.0 and also on 5) in that it is no
longer activating the Acrobat Reader to display
the file - it is instead bringing up an 'Open/Save' dialog box as if it did
not recognize the Mime type - though the Type
of the document is recognized as 'Adobe Acrobat' in the dialog box.
I have done some searching in the documentation and in the Tomcat source on how we can disable the charset being appended - but to no avail so far (I know we can change the character encoding in the wrapper implementation of Response, but at that point in the code we only have access to the HttpServletResponse object - which does not have the corresponding setCharacterEncoding method)
Am I missing something? Is there a way to set the Character Encoding in the configuration files? We are using Struts also - which I know has a 'default content type' parameter that can be set - but Im not sure this will help us in this circumstance!
This issue has been correctled already. However, I'd like to point out that ISO-8859-1 is the default in HTTP/1.1 for the entity body, so the two should be equivalent.
To fix the issue, you need to get a new org.apache.coyote.Response class compiled from CVS and put it in server/classes.
-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxx R�my Maucherat Senior Developer & Consultant JBoss Group (Europe) S�RL xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
