Posted By:
liliyaw_woland
Posted On:
Thursday, March 30, 2006 11:28 AM
Please help, 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 code on linux opens up a pdf viewer for the created .pdf file. As a result, you cant see the page from a different computer. I'd appreciate any input, thanks in advance. 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.writeT
More>>
Please help,
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 code on linux opens up a pdf viewer for the created .pdf file. As a result, you cant see the page from a different computer. I'd appreciate any input, thanks in advance.
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