title: update table with ajax and spring mvc
body: <p>I try to refresh a table in my jsp page.<br>
  My table load a list with all  possible result.
  But after a search i want update my table just with result of search.</p>
  
  <p>My table:</p>
  
  <pre><code>&lt;table id="table_grid"&gt;
  [...]
  &lt;c:forEach items="${cardlist}" var="card" &gt;
  &lt;tr&gt;
      &lt;td&gt;${card.name}&lt;/td&gt;
      [...]
  &lt;/tr&gt;
  &lt;/c:forEach&gt;            
  [...]
  &lt;/table&gt;
  </code></pre>
  
  <p>My search form:</p>
  
  <pre><code>&lt;form:form modelAttribute="searchform" id="formSearch" action="#"&gt;
  &lt;form:select path="critere" &gt;
    &lt;option value="1"&gt;name&lt;/option&gt; 
    [...]
  &lt;/form:select&gt;
  &lt;form:input type="text" path="value"/&gt;
  &lt;input type="button" value="Search" onclick="searchAjax()"/&gt;
  </code></pre>
  
  <p>            </p>
  
  <p>My ajax call:</p>
  
  <pre><code>function searchAjax() {
  $.ajax({
      url : 'searchlostcard',
      type: 'POST',
      data:$('#formSearch').serialize(),
      success : function(responce) {   
  
          /* what  i have to put here to updte my table &lt;table id="table_grid"&gt; */
  
      },      
      error : function(){
          alert("error");
      }
  });
  </code></pre>
  
  <p>}</p>
  
  <p>i want my table to be updated by this list <code>listlostcard</code> of my controller:</p>
  
  <pre><code>@RequestMapping(value="/searchlostcard") 
  public  @ResponseBody
  void searchlostcard(@ModelAttribute(value="searchform") SearchForm searchForm) {    
  
  List&lt;Lostcard&gt; listlostcard = lostcardRepository.findByNom(searchForm.getValue());
  
  /*How to update list cardlist here*/
  }
  </code></pre>
  
  <p>i try this <code>model.put("cardlist", listlostcard);</code> and in ajax call<code>success : function(responce) { $('#table_grid').update(); }</code> but it didn't work.</p>