Search code examples
javajavascriptjstljsp-tags

Iterating HashSet using JSTL


I have a Set of Objects. I want to iterate these objects from set to display it on jsp using JSTL. It is working with List, but I need to use Set.

Is it possible with jstl to iterate a set ?

<c:forEach items="${pitches}" var="pitch" />

In above : pitch has a set of object say Set<employee> ...

How can I iterate this employee set inside pitch ???


Solution

  • Yes <c:forEach> works with all Iterable so Set should be good