title: JQuery DataTable+ajax+struts2+json
body: <p>Good day everyone. I have a web application built on java+struts2. In one of my webpage I have used JQuery tabs and In one of the tabs I am trying to populate the table with so many records which I fetch from DB. After 2 days of google search I have decided to go with JQuery Data table to populate the table with pagination. I am new to JQuery and Ajax. I have so many doubts in doing that. I am unable to find sample tutorial/example which does this work. </p>
  
  <p>HTML :</p>
  
  <pre><code>&lt;div id="ViewIncome"&gt;
      &lt;table id="IncomeTable" class="display" cellspacing="0" width="100%"&gt;&lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Struts.xml</p>
  
  <pre><code>&lt;action name="refreshData" class="com.hibernate.action.UserIncomeAction" method="dataRefresh"&gt;
          &lt;result type="json"&gt;&lt;/result&gt;
  &lt;/action&gt;
  </code></pre>
  
  <p>Action Class Method:</p>
  
  <pre><code>//Income class variables are 'incomeID','amount','description' etc.,
  private List&lt;Income&gt; incomesList;
  
  public String dataRefresh()
  {
      if(checkUserLogin())
      {
          //code to fetch the latest data from DB;
          return SUCCESS;
      }
      else
      {
          return LOGIN;
      }
  }
  </code></pre>
  
  <p>JQuery: Updated Code.</p>
  
  <pre><code> $("#IncomeTable").dataTable({
      "sPaginationType" : "full_numbers",
      "bProcessing" : false,
      "bServerSide" : false,
      "sAjaxSource" : "refreshData",
      "bJQueryUI" : true,
      "aoColumns" : [
  { "incomesList": "amount" },
  { "incomesList": "description" }
  ]
  } );
  </code></pre>
  
  <p>Now How do I iterate the  <code>List&lt;Income&gt; incomesList;</code> in the above JQuery code. Also let me know if I need to add any additional lib/jar if I have to use the datatable. I have JQuery-Ui lib placed in my project.</p>
  
  <p>Can some One help me with the link's or examples in achieving my desired output.</p>
  
  <p><a href="https://i.stack.imgur.com/xrM53.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xrM53.png" alt="Data table"></a></p>