Jump to content
We've recently updated our Privacy Statement, available here ×

IE6+PDF+SSL


ChristFollower

Recommended Posts

I have a Struts application. The following code is in an Action method which is invoked from a JSP. On the JSP, I use target="_blank" so it brings up a 2nd page displaying the PDF. The problem we have is that it doesn't display the PDF on our PRODUCTION server running SSL. With IE7, if I check the "Do not save encrypted pages to disk" it would fix the problem. However, in IE6, it still doesn't display. FireFox 2.0 works normally. I wonder if anyone has experienced similar problem and can suggest some solutions. Thanks.

 

Danny

 

 

JasperPrint jasperPrint = JasperFillManager.fillReport(jasperFile, parameters, new JRBeanCollectionDataSource(inmateFactSheetInfo));

jasperPrintList.add(jasperPrint);

 

response.setContentType("application/pdf");

 

log.debug("Sending report list to PDF exporter...");

 

JRPdfExporter exporter = new JRPdfExporter();

exporter.setParameter(JRExporterParameter.JASPER_PRINT_LIST, jasperPrintList);

 

OutputStream ouputStream = response.getOutputStream();

exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream);

 

try {

log.debug("Exporting report to PDF...");

exporter.exportReport();

} catch (JRException e) {

throw new ServletException(e);

} finally {

if (ouputStream != null) {

try {

log.debug("Closing output stream...");

ouputStream.close();

log.debug("Output stream closed...");

} catch (IOException ex) {

}

}

}

Link to comment
Share on other sites

  • 4 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Hi,

 

we had a similar problem. There is a bug by Microsoft related to this problem: Bug Report .

We solved this by manually setting headers of the response, e.g.:

 

Code:
String userAgent = request.getHeader("user-agent"«»);
if (userAgent != null && userAgent.toUpperCase().indexOf("MSIE"«») > -1)
{
response.setHeader("Pragma", "public"«»);
response.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0"«»);
response.setHeader("Content-Transfer-Encoding", "binary"«»);
}
response.setContentType("application/pdf"«»);
response.setHeader("Content-Disposition", "Attachment; filename=Print.pdf"«»);

 

I hope this is useful for you.

 

Greetings Stefan

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...