最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - Iterating HashSet using JSTL - Stack Overflow

programmeradmin1浏览0评论

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 ???

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 ???

Share Improve this question edited Mar 4, 2013 at 19:49 Dave Newton 160k27 gold badges260 silver badges307 bronze badges asked Mar 4, 2013 at 19:31 AliAli 1,5902 gold badges20 silver badges30 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 5

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

JSTL tag <c:forEach> works with any Collection implementation

From docs:

The basic iteration tag, accepting many different collection types and supporting subsetting and other functionality

发布评论

评论列表(0)

  1. 暂无评论