This content has been marked as final.
Show 2 replies
-
1. Re: PDF download with richfaces wont work
mail.micke Sep 26, 2007 11:58 AM (in response to marc1)Hi,
are you setting the correct content type in the action?
I'm also a bit curious about why you want to use the a4j components for this?
Cheers -
2. Re: PDF download with richfaces wont work
marc1 Sep 27, 2007 5:34 AM (in response to marc1)yes, that is working right, like
.. byte[]pdf = getPDF(); FacesContext faces = FacesContext.getCurrentInstance(); HttpServletResponse response = (HttpServletResponse) faces .getExternalContext().getResponse(); response.setContentType("application/pdf"); response.setContentLength(pdf.length); response.setHeader("Content-disposition", "attachment; filename=" + "mypdf.pdf"); response.getOutputStream().write(pdf); faces.responseComplete(); ..
since the tags with <h:commandLink..> works correctly. it is just when i chnage the tags to <a4j:..> that it fails.
the reason i need an ajax call is to start something like a progress bar while the pdf is downloading.
marcelo