I have a jsp page with below for loop:
<c:forEach var="myItem" items="${itemsList}">
<table border="0" class="table_class">
<tr>
<td colspan="1" valign="bottom">Item #${myItem.item_number}
</td>
<td colspan="2" align="left"><b>Item Name : ${myItem.item_name}</b>
</td>
</tr>
<tr>
<td class="gridcolumnclass">${myItem.item_desc}
</td>
</tr>
</table>
</c:forEach>
As clear, for every item, two rows gets published with first row having two columns containing ITEM_NUMBER and ITEM_NAME while the second row containing ITEM_DESCRIPTION.
For e.g., I have below set of items
1, banana, some_desc
2, banana, some_desc
3, apple, some_desc
4, banana, some_desc
5, banana, some_desc
6, apple, some_desc
7, apple, some_desc
8, banana, some_desc
9, apple, some_desc
10, apple, some_desc
11, banana, some_desc
If above list is passed to the for loop, on the display, there will be two bananas, then an apple, then again two bananas, then two apples, then one banana, then two apples and finally a banana in the given order.
However, how could I group apples and bananas together ?
My display should show all bananas first and then apples.
Thanks for reading.