jstl sorting Arraylist
829468Jan 7 2011 — edited Jan 9 2011i have used jstl to iterate Arraylist to display car name,price and other details.
Can anyone help me in sorting out the table based on list box value selected.ie sort by name,sort by model,sort by price,,
please suggest me ,if it can be done using any taglib
------------------------------------------------------------------------------
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<body>
<h1>Car List</h1>
<h1></h1>
<select>
<option>Sort by Name</option>
<option>Sort by Model</option>
<option>Sort by Price</option>
</select>
<table>
<c:forEach items="${carList}" var="car">
<tr>
${car.brand.name} ${car.model}: ${car.price}
</tr>
</c:forEach>
</table>
</body>
</html>
----------------------------------------------------------------------------------------------------------------