日期:2014-05-16  浏览次数:20341 次

EL jsp页面便利List map array

List:
<c:forEach var="student" items="${sessionScope.list}"
?varStatus="status">
<font size=5 color=blue> index:${status.index }<br>
ID:${student.id }<br> Name:${student.name }<br>
Country:${student.address.country }<br>
City:${student.address.city }<br>
Street:${student.address.street } <br></font>
</c:forEach>
Map:
<c:forEach var="entry" items="${sessionScope.map}"
begin="0" end="4" step="1" varStatus="status" >
<font size=5 color=red> index:${status.index }<br>
ID:${entry.key }<br> Name:${entry.value.name }<br>
Country:${entry.value.address.country }<br>
City:${entry.value.address.city }<br>
Street:${entry.value.address.street }<br> </font>
</c:forEach>
Array:
<c:forEach var="color" items="${sessionScope.colors}">
${color}<br>
</c:forEach>

?