`

JSP页面EL遍历List Map Array

    博客分类:
  • java
阅读更多

JSP页面EL遍历List Map Array

Html代码
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:

  
  1. < c:forEach   var = "color"   items = "${sessionScope.colors}" >   
  2. ${color}< br >   
  3. </ c:forEach >  
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics