Re: return pdf from database blob?
;filename=\ + fileName + \); FileInputStream fis = null; OutputStream os = null; fis = new FileInputStream(new File(folder, fileName)); if (fis != null) { os = response.getOutputStream(); if (os != null) { int read = 0; byte[] bytes = new byte[1024]; while ((read = fis.read(bytes)) != -1) { os.write(bytes, 0, read); } os.flush(); os.close(); } } FacesContext.getCurrentInstance().responseComplete(); } } } -Original Message- From: Mike Kienenberger [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 06, 2007 4:19 PM To: MyFaces Discussion Subject: Re: return pdf from database blob? http://wiki.apache.org/myfaces/Sending_Files On 2/6/07, Mick Knutson [EMAIL PROTECTED] wrote: I want to have a table of pdf documents in my database that I want to return to my web users. Is there an example of having a MyFaces jsp return pdf document verse html? -- --- Thanks, Mick Knutson http://www.baselogic.com http://www.blincmagazine.com http://www.djmick.com http://www.myspace.com/djmick_dot_com http://www.thumpradio.com ---
RE: return pdf from database blob?
why not just create a simple servlet that does it? or asked differently: why would you need the JSF-lifecycle for this PDF download? regards Alexander From: Mick Knutson [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 07, 2007 12:21 AM To: MyFaces Discussion Subject: return pdf from database blob? I want to have a table of pdf documents in my database that I want to return to my web users. Is there an example of having a MyFaces jsp return pdf document verse html? -- --- Thanks, Mick Knutson http://www.baselogic.com http://www.blincmagazine.com http://www.djmick.com http://www.myspace.com/djmick_dot_com http://www.thumpradio.com ---
Re: return pdf from database blob?
http://wiki.apache.org/myfaces/Sending_Files On 2/6/07, Mick Knutson [EMAIL PROTECTED] wrote: I want to have a table of pdf documents in my database that I want to return to my web users. Is there an example of having a MyFaces jsp return pdf document verse html? -- --- Thanks, Mick Knutson http://www.baselogic.com http://www.blincmagazine.com http://www.djmick.com http://www.myspace.com/djmick_dot_com http://www.thumpradio.com ---