dcsimg
.pdf files created by a servlet(on Tomcat) don't open in the browser, but with a linux pdf viewer
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   liliyaw_woland
Posted On:   Thursday, March 30, 2006 11:18 AM

The code I'm testing - a servlet - works fine in Windows OS. A servlet creates a pdf file in a .jsp page. But the same servlet on linux opens up a pdf viewer for the created .pdf file. And as a result when the .jsp page is accessed from a different computer the page can not be located. Any suggestions anyone? THis is the code I'm using: Pdf p = new Pdf(req.getParameter("pdfFile")); ServletOutputStream out = resp.getOutputStream(); resp.setHeader("Content-Type", "application/pdf"); resp.setHeader("Content-Disposition", "inline; filename="" + pdfOut + """); ByteArrayOutputStream ba = new ByteArrayOutputStream(); p.writeToStream(ba); resp.setContentLength(ba.size()); ba.writeTo(out);   More>>

The code I'm testing - a servlet - works fine in Windows OS. A servlet creates a pdf file in a .jsp page. But the same servlet on linux opens up a pdf viewer for the created .pdf file. And as a result when the .jsp page is accessed from a different computer the page can not be located. Any suggestions anyone?
THis is the code I'm using:
Pdf p = new Pdf(req.getParameter("pdfFile")); ServletOutputStream out = resp.getOutputStream(); resp.setHeader("Content-Type", "application/pdf"); resp.setHeader("Content-Disposition", "inline; filename="" + pdfOut + """); ByteArrayOutputStream ba = new ByteArrayOutputStream(); p.writeToStream(ba); resp.setContentLength(ba.size()); ba.writeTo(out); out.flush();

   <<Less

Re: .pdf files created by a servlet(on Tomcat) don't open in the browser, but with a linux pdf viewer

Posted By:   Almagest_FUTT  
Posted On:   Thursday, March 30, 2006 05:30 PM

About | Sitemap | Contact