title: How to save file with .xlsx by setting the content type
body: <p>Code tried in  jsp  given below .The code below opens the window explorer in  to save the file to .xlsx (using chrome browser)but the requirement is to auto download the file while clicking the icon .tried solutions of the similar question posted in stack overflow but could not find a correct solution to the question.</p>
  
  <p>Solution checked in browser Firefox and in chrome </p>
  
  <pre><code>&lt;%@ taglib uri="/struts-tags" prefix="s"%&gt;
  &lt;%
      response.setContentType("application/application/vnd.openxmlformats-
       officedocument.spreadsheetml.sheet");
       response.setHeader ("Content-Disposition", 
       "attachment;fileName=tempAuthorizationCloseOutReportsResult.xlsx;");
   %&gt;
  
   &lt;s:set var="resultList" value="#request.tempAuthorizationCloseoutResult" /&gt;
  
  
   &lt;div&gt;
      &lt;h3&gt;&lt;/h3&gt;
   &lt;/div&gt;
  &lt;br/&gt;
  &lt;s:if test="#resultList.size &lt;= 0"&gt;
       &lt;table&gt;
        &lt;tr&gt;
          &lt;td&gt;    
              &lt;b&gt; &lt;s:text name="ui.label.text.norecordsfound" /&gt; &lt;/b&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/s:if&gt;
  
  &lt;s:elseif test="#resultList.size&gt; 0"&gt;
   &lt;table&gt;
    &lt;tr&gt;
      &lt;td&gt;    
          &lt;b&gt;&lt;s:text name="ui.label.text.totalnumberofrecordsfound"/&gt; : 
          &lt;s:property value="#resultList.size" /&gt; &lt;/b&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>