tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid...@pidster.com>
Subject Re: PDF problem on IE from JSP
Date Wed, 16 Jan 2008 14:25:58 GMT
Jonadan wrote:
> Hi,
> 
> I am generating PDF documents from JSP directly to output stream. However
> when I try it from IE, it does not work properly. Sometime nothing happens.
> Sometimes, show data corruption error. Sometimes connection error, etc.
> 
> I suspect it may be something to do with partial content reading from IE and
> Tomcat does not support or my JSP does not take care, etc.
> 
> Anyone had the same problems before?
> 
> Jonadan.
> 

Yes, it's pretty common, especially if you're using SSL. Search google.

The best solution I found was to avoid sending the official PDF 
mimetype, send a generic one instead, and force it to download*.

Something like:

response.setContentType("application/x-download-file");
response.setHeader("Content-Disposition",
   "attachment; filename=" + filename + "; size=" + content.length );



(Also because the Acrobat browser plugin used to take so long to start 
up, but I'm not sure if that's still true.)



p

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message