Thomas Wittpahl wrote:
>
> I want to send a PDF - File, which is generated by a Bean, to the Client. I
> have to send an byte[] back, but only an OutputStream can handle this.
>
> --- JSP - CODE ---
>
> response.setContentType("application/pdf");
> ServletOutputStream out = res.getOutputStream();
> out.write(eng.getPageData(1));
>
> ------------------
>
> eng.getPageData(1) -> byte[]
>
> Can I generate an OutputStream instead of a PrintWriter? - It does not work
> to generate an OutputStream and an PrintWriter!
>
> Is it possible give the JSPCompiler a parameter, that generates an OutputStream
> instead of the PrintWriter?

No. Use the right tool for each task: JSP is strictly for text output, servlets
can be used for both binary and text. So in this case you should use a servlet.

Hans
--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to