private String stheme;
private String slevel;
private Double spyPrice;
private Double setPrice;
private Set<SceneryPic> sceneryPics=new HashSet<SceneryPic>();以上是这个pojo的所有字段,是Hibernate的一对多关系,这是一的一方,查询出来的一方是List<pojo> 我要取到这个pojo的对应的多方也就是这个Set<>
要获得这个Set<>的sceneryPics中的第一个,用EL表达式不管是Foreach还是iterator,只要出来就好。页面是JSP的
private String slevel;
private Double spyPrice;
private Double setPrice;
private Set<SceneryPic> sceneryPics=new HashSet<SceneryPic>();以上是这个pojo的所有字段,是Hibernate的一对多关系,这是一的一方,查询出来的一方是List<pojo> 我要取到这个pojo的对应的多方也就是这个Set<>
要获得这个Set<>的sceneryPics中的第一个,用EL表达式不管是Foreach还是iterator,只要出来就好。页面是JSP的
<c:forEach items="${list}" var="pojo">
<c:forEach items="${pojo.sceneryPics}" var="sceneryPic">
${sceneryPic}
</c:forEach>
</c:forEach>
HTML code
<c:forEach items="${list}" var="pojo">
<c:forEach items="${pojo.sceneryPics}" var="sceneryPic">
${sceneryPic}
</c:forEach>
</c:forEach>
[/Quote]