title: How to group rows with duplicate column properties in a JSTL c:forEach
body: <p>I am programming in Java and I have a list of objects I'd like to iterate in JSTL to check if other elements have some similarity with current one. And I'd like to do it in my jsp because it's just a display matter.</p>
  
  <p>Let's take a dummy example and say my object has three properties : id, lastname and firstname. id would be the identifier of a family and I want to display the list in an HTML table BUT while iterating my list I want to check the rest of the list to see if other family members are present so I could regroup them in one td tag.</p>
  
  <pre>
  1 | TOTO   | James 
  2 | FOE    | Cameron 
  2 | FOE    | Jessica 
  1 | TOTO   | Pat
  3 | SAMPLE | Bob
  </pre>
  
  <p>Expected result :</p>
  
  <pre><code>&lt;table&gt;
     &lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;TOTO&lt;/td&gt;&lt;td&gt;James, Pat&lt;/td&gt;&lt;/tr&gt;
     &lt;tr&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;FOE&lt;/td&gt;&lt;td&gt;Cameron, jessica&lt;/td&gt;&lt;/tr&gt;
     &lt;tr&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;SAMPLE&lt;/td&gt;&lt;td&gt;Bob&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Again, this is a basic example and you might be tempted to tell me to regroup my families in an other object in my Model layer but I'd rather not to do that.</p>
  
  <hr>
  
  <p><strong>Edit:</strong> I am implying a while loop because my list is ordered by id so I could easily check the next elements. But other solutions would be fine for me.</p>