c:forEach标签可用于循环,也可用于遍历数组,List,Map集合等
循环输出:
<h1>循环输出1到10</h1>
<table border="1">
<c:forEach begin="1" end="10" var="i">
<tr><td>第${i}行</td></tr>
</c:forEach>
</table>
遍历数组:
<h1>遍历数组</h1>
<% request.setAttribute("arr",new String[]{"234324324","4553545","676577"});%>
<c:forEach items="${requestScope.arr}" var="item">
${item}
</c:forEach>
<hr>
遍历Map集合
<h1>遍历Map集合</h1>
<% Map<