title: how to export/generate two files at once?
body: <p>I have an requirement of generating two excel files at once. We are using Apache POI for generating excel files and struts framework.</p>
  
  <p>Within the action class, the steps are like,</p>
  
  <pre><code>OutputStream outputStream = response.getOutputStream();
  </code></pre>
  
  <p>and then populate data from db and created one file using POI and called,</p>
  
  <pre><code>response.setContentType("application/vnd.ms-excel");
  response.setHeader("Content-Disposition",
                   "attachment; filename=ExportFile1.xls");
  workbook.write(outputStream);
  outputStream.flush();
  </code></pre>
  
  <p>and followed same steps(populate data from db, write excel content) for second file as,</p>
  
  <pre><code>response.setContentType("application/vnd.ms-excel");
  response.setHeader("Content-Disposition",
                   "attachment; filename=ExportFile2.xls");
  workbook.write(outputStream);
  outputStream.flush();
  </code></pre>
  
  <p>But only one file is generated.</p>
  
  <p>Is this possible in java to generate two files at once? Have anyone implemented this?</p>
  
  <p>Pls note: Generating two sheets within one excel file is not required.</p>