Java:在JSP页面中怎么遍历Session中的集合里对象的属性 Session中放的是一个List<Student>

定义了一个Student类 有属性 id,name
在Servlet里的Session里放一个Student 集合list
session.setAttribute("a",list);
问如何在JSP页面中遍历这个session的id和 name

用<c:forEach >标签怎么写
牛人写出部分代码
谢谢了啊

<c:forEach var="aa" items="a"><!-- a是你session传过来的集合 -->
<c:out value="${aa.id}"></c:out>
<c:out value="${aa.name}"></c:out>
</c:forEach>
温馨提示:内容为网友见解,仅供参考
第1个回答  2010-09-15
<c:forEach items="${sessionScope.a}" var="student">
<c:out value="${student.id}"/>
<c:out value="${student.name}"/>
</c:forEach>
第2个回答  2010-09-15
呵呵,我不会,我只个人,不是牛,更不是牛人,牛人应该是带犄角的吧
相似回答