This content has been marked as final. Show 2 replies
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?
yes, that is working right, like
.. bytepdf = 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.