Ok... I've made some research on that too... I'm actually generating a report (.pdf file) with jasper, and it already enables me to export it to an outputstrem, as in this code:
memoryPDF = new FileOutputStream("test"); this.bytes = JasperRunManager.runReportToPdf(jasperReport,parameters,this.getReport()); JasperExportManager.exportReportToPdfStream(bytes,memoryPDF); This code is located in a method on my bean, which is on the action of a <h:commandButton/>. After creating the file, i don't know what to do to send it as response. What i was doing when i had the document on server before Tomcat startup was: HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse(); response.sendRedirect("test"); If you could help me sending this file created to be downloaded, it would be a lot of help...