Ravi
Ravi

Reputation: 8209

How can I retrieve all values from a Map using EL

I have a SortedMap which I'm populating in my service classes, I want to display all the values stored in the map in a sorted order. How can I do that using EL (Expression language). Also how can I access the keys?

Thanks for the help.

Ravi.

Upvotes: 0

Views: 518

Answers (1)

Drew Wills
Drew Wills

Reputation: 8446

So:

<ol>
  <c:forEach items="${myMap}" var="item">
    <li><c:out value="${item.key}"/>=<c:out value="${item.value}"/></li>
  </c:forEach>
</ol>

Upvotes: 3

Related Questions