title: How to export JSP table to EXCEL (XLSX Format)
body: <pre><code> &lt;%@ page language="java" contentType="application/vnd.ms-excel"%&gt;
     &lt;% response.setHeader("Content-Disposition:","attachment;filename=Sample.xls"); %&gt; 
   &lt;TABLE&gt;
    &lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;
      &lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;
     &lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;
      &lt;/TABLE&gt;
  </code></pre>
  
  <p>How to export the JSP table in XLSX format and how to suppress the following exception<br>
  The file you are trying to open, <code>name.ext</code>, is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?</p>