特性 Getter 描述
current getCurrent() 当前这次迭代的(集合中的)项
index getIndex() 当前这次迭代从 0 开始的迭代索引
count getCount() 当前这次迭代从 1 开始的迭代计数
first isFirst() 用来表明当前这轮迭代是否为第一次迭代的标志
last isLast() 用来表明当前这轮迭代是否为最后一次迭代的标志
begin getBegin() begin 属性值
end getEnd() end 属性值
step getStep() step 属性值
特性 Getter 描述
current getCurrent() 当前这次迭代的(集合中的)项
index getIndex() 当前这次迭代从 0 开始的迭代索引
count getCount() 当前这次迭代从 1 开始的迭代计数
first isFirst() 用来表明当前这轮迭代是否为第一次迭代的标志
last isLast() 用来表明当前这轮迭代是否为最后一次迭代的标志
begin getBegin() begin 属性值
end getEnd() end 属性值
step getStep() step 属性值
<%
String[] names={"John","Lisa","James"};
session.setAttribute("names",names);
%>
<c:forEach var="name" items="${names}" varStatus="s">
<h5>
<c:out value="${name}"></c:out>
</h5>
current:${s["current"]} <br/>
index:<c:out value="${s['index']}"></c:out><br/>
count:<c:out value="${s['count']}"></c:out><br/>
first:<c:out value="${s['first']}"></c:out><br/>
last:<c:out value="${s['last']}"></c:out><br/>
<hr/>
</c:forEach>
