title: Primefaces fileDownload warning SRTServletResponse cannot set status
body: <p>I am using Primefaces to provide file download action in JSF. The code I am using is:</p>
  
  <pre><code>&lt;p:commandButton id="xlsExport" value="Export XLS"
      ajax="false"
      onclick="PrimeFaces.monitorDownload(startPleaseWaitMonitor, stopPleaseWaitMonitor);"&gt;
      &lt;p:fileDownload value="#{SampleBean.XLSExport}" /&gt;
  &lt;/p:commandButton&gt;
  </code></pre>
  
  <p>SampleBean has the following method:</p>
  
  <pre><code>public StreamedContent getXLSExport() {
      ...
      byte[] content = generator.generateXLS();
      return new DefaultStreamedContent(new ByteArrayInputStream(content), "application/vnd.ms-excel", fileName, "UTF-8");
  }
  </code></pre>
  
  <p>I am using it on two application servers - JBoss and Websphere. In case of Websphere I see warning in server logs when I do export:</p>
  
  <blockquote>
    <p>000000f5 SRTServletRes W
    com.ibm.ws.webcontainer.srt.SRTServletResponse setStatus WARNING:
    Cannot set status. Response already committed.</p>
  </blockquote>
  
  <p>When I run similar method but for CSV export there is no warning. For JBoss there is no warning too. </p>
  
  <p>What could be the reason for such log warning?</p>