title: How to do sorting in dynamic content of table in jsp,struts2?
body: <p>I am new to do this sorting technique in jsp page of dynamic content. My application is integrated with struts2+jsp+hibenate. I am using the following code in jsp.</p>
  
  <p>report.jsp</p>
  
  <pre><code>          &lt;table class="report_view_table" id="results"&gt;
      &lt;thead&gt;
          &lt;tr&gt; &lt;th width="35" scope="col" abbr="no"&gt;No
              &lt;/td&gt;
              &lt;th width="50" scope="col" abbr="status"&gt;Date
              &lt;/td&gt;
              &lt;th width="80" scope="col" abbr="option"&gt;productName
              &lt;/td&gt; 
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
    &lt;s:if test="resultList.size() &gt; 0"&gt;
    &lt;s:if test="productName.size() &gt; 0"&gt;
    &lt;s:iterator status="rowNo" value="resultList"&gt;
        &lt;s:set name="Result_product" value="%{productId}" /&gt;
    &lt;tr&gt; &lt;td&gt;&lt;span class="check"&gt;&lt;s:property value="%{#rowNo.count}" /&gt;&lt;/span&gt;&lt;/td&gt;
         &lt;td&gt;&lt;span class="check"&gt;&lt;s:property value="%{proDate}" /&gt;&lt;/span&gt;&lt;/td&gt;
         &lt;td&gt;&lt;span class="check"&gt;&lt;s:iterator value="productName"&gt; 
             &lt;s:set name="product"value="%{productId}" /&gt; 
             &lt;s:if test="%{#product== #Result_product}"&gt;
          &lt;s:property value="%{productionName}" /&gt; &lt;/s:if&gt;&lt;/s:iterator&gt;
         &lt;/span&gt;&lt;/td&gt;
     &lt;/tr&gt;
     &lt;/s:iterator&gt;
     &lt;/s:if&gt;
     &lt;/s:if&gt;
     &lt;s:else&gt;No report is available
     &lt;/s:else&gt;
      &lt;s:else&gt;No report is available
     &lt;/s:else&gt;
         &lt;/tbody&gt;
     &lt;/table&gt;
  </code></pre>
  
  <p>Here, i want to sort the table by its column heading. how to sort this dynamic content of table. Anybody please help me to do this functionality. <strong>Thanks in advance</strong>.</p>