I need to 开发者_如何学Cuse a set to not allow duplicate values.
I need to list them out using the JSTL
<c:forEach items="${mySet}" var="set">
//Code work done here
</c:forEach>
Usually I use the standard array or List here but what are the type restrictions if I want to use a HashSet?
As of JSTL 1.1 mr2: Collection
, Map
, arrays, Iterator
and Enumeration
.
Check this page: http://www.ibm.com/developerworks/java/library/j-jstl0318/
Hashset implements java.util.Collection so it should work.
精彩评论