title: How to display Excel content from Struts portlet on Websphere Portal
body: <p>Here is the code, it don't display the .csv file:</p>
  
  <pre><code>public class ForwardAction extends MultiAction {
  private static final String FILE_ERROR = "&lt;h3&gt;&lt;center&gt;INVALID FILE&lt;/center&gt;&lt;/h3&gt;";
      public ActionForward doVizualizare(ActionMapping mapping, ActionForm form,
          HttpServletRequest request, HttpServletResponse response)
          throws Exception {
  
      StringBuffer sb = new StringBuffer();
      sb.append("Name,Email,Phone");
      sb.append(System.getProperty("line.separator"));
      sb.append("Naveen,naveen@ibm.com,111-111-111");
  
      OutputStream resOut = response.getOutputStream();
      try {
          response.setContentType("application/octet-stream"); 
          response.setHeader("Content-Disposition", "attachment; filename=\"a.csv\"");
          resOut.write(sb.toString().getBytes());
      } catch (Exception e) {
          resOut.write(FILE_ERROR.getBytes());
      }
      return null;
  }
  }
  </code></pre>