What is the correct/supported way to download a file, such as a spreadsheet, to the browser from a portlet? In a stand-alone application, I can do the following, but it doesn't work from the portlet:
// Set the content type for the response response.setContentType("application/vnd.ms-excel"); // Open the output stream outputStream = response.getOutputStream(); // Generate content and write it to the output stream createRows(outputStream); // clean resources outputStream.flush(); outputStream.close();
- JBoss Enterprise Portal Platform (EPP)
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.