title: Spring MVC ajax re-rerendering user interface duplication
body: <p>First of all I am mainly with a <code>JSF</code> background. </p>
  
  <p>I have started recently studying <code>Spring MVC</code>. One thing that is bothering me is the ajax re-rendering when using <code>Spring MVC</code> and <code>JQuery</code>.</p>
  
  <p>Let's imagine that I have defined a complex form in my <code>people.jsp</code> view:</p>
  
  <pre><code>&lt;c:forEach var="person" items="${people}"&gt;
     &lt;table&gt;
         &lt;tr class="trPersonClass"&gt;...&lt;/tr&gt;
         &lt;tr&gt;...&lt;/tr&gt;
     &lt;/table&gt;
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p>And I have a <code>refresh</code> button below. When the refresh button is clicked I want with <code>ajax</code> the <code>people</code> to rerender.</p>
  
  <pre><code>function refreshButtonClicked() {
      $.ajax({
         type: "GET",
         url: "ajax/loadPeople.do"
      }).done(function( msg ) {   
          //WHAT SHOULD I DO HERE???            
      } 
  });
  </code></pre>
  
  <p>So what I should do there? I have already defined how the people rendering should like with the <code>c:forEach</code> tag in my <code>jsp</code>. I don't want to repeat it again. I don't want to duplicate user interface code at both places - in the <code>JQuery</code> done callback and with <code>JSP</code> tags in my views. This is error prone in my opinion.</p>
  
  <p>Please explain me kindly what I am missing here.</p>