title: Passing HTML table from JSP to Java request object
body: <p>I wanted to know if there is a way in which I can pass an HTML table from my JSP page using the Java request object.</p>
  
  <p>More precisely, this is what my table looks like..</p>
  
  <p><code>
  table id="tableid"<br>
  thead<br>
  tr<br>
  th...column1 header.../td<br>
  th...column2 header.../td<br>
  /tr<br>
  /thead</p>
  
  <p>tbody<br>
  tr<br>
  td...column1 data../td<br>
  td..column2 data../td<br>
  /tr<br>
  /tbody  </p>
  
  <p>/table  </p>
  
  <p></code></p>
  
  <p>I've a method in my Java code getExcelVersion(), for which I wanted to pass the above table as an argument.</p>
  
  <p>I actually wanted to pass data from the table(column1 data, column2 data) as an List, ArrayList or anything data type, and not the actual HTML. What I'm basically trying to achieve is something as follows:</p>
  
  <p>I've an HTML table, that I need to export to excel on a button click. For this purpose, I'm using libraries from Apache-POI, and the foll. code block.</p>
  
  <p><code>
  HSSFWorkbook workbook = getExcelVersion(); 
  resp.setContentType("application/vnd.ms-excel"); 
  resp.setHeader("Content-Disposition", "attachment; filename=\"contacts.xls\""); workbook.write(resp.getOutputStream()); 
  resp.flushBuffer();
  </code></p>
  
  <p>Now, I wanted to know how would I pass table data(column1 data, column2 data) to my getExcelVersion() method.</p>
  
  <p>Thanks,<br>
  Pritish.</p>