public StreamedContent getAttachment(){
portletResourceResponse.setContentType("application/pdf"); //application/pdf
portletResourceResponse.setProperty("Content-Disposition", "attachment");
try{
portletResourceResponse.flushBuffer(); OutputStream out = portletResourceResponse.getPortletOutputStream();
out.write(------);
out.flush();
facesContext.responseComplete();
out.close();
}catch(Exception e)
{
e.printStackTrace();
}
return null;
}
Comments
Post a Comment