I am try to show an pdf in jsp page without saving this in the hard disk. I was able to generate a pdf and I tested it by saving it in hard disk. I am using DynamicJasper as reporting engine.
Here is my strut.xml for dynamic-jasper:
<action name="myJasperTest" class="com.via.qcm.view.JasperAction">
<result name="success" type="dynamic-jasper">
<param name="dynamicReport">DynamicReport</param>
<param name="layoutManager">classic</param>
<param name="parameters">dynamicReportDs</param>
<param name="documentName">report</param>
<param name="contentDisposition">application/download</param>
<param name="format">PDF</param>
</result>
I am generating pdf and saving it in ByteArrayOutputStream()
.
baos = new ByteArrayOutputStream();
//export to pdf
Exporter.exportToPdf(jp, baos);
Now my question is how to show this "baos" in webpage as pdf?