Jstl标签怎么显示当前运行到第几次循环了,我没有设ID字段 <c:forEach items="${callloglist}" var="callloglist" varStatus="count">
<tr>
<td align="center">${callloglist.callType }</td>
<td>${callloglist.hostTel }</td>
<td>${callloglist.callName }</td>
<td>${callloglist.byTel }</td>
<td>${callloglist.callBeginTime } </td>
<td>${callloglist.callTime }</td>
<td><a href="/srg/callLog.do?method=viewCallLog&Id=${count}">详细</a></td>
</tr>
</c:forEach>就是想在“<a href="/srg/callLog.do?method=viewCallLog&Id=${count}">详细</a>”这里传一个列数过去&Id=${count}
是不是用varStatus属性里的count???????
<tr>
<td align="center">${callloglist.callType }</td>
<td>${callloglist.hostTel }</td>
<td>${callloglist.callName }</td>
<td>${callloglist.byTel }</td>
<td>${callloglist.callBeginTime } </td>
<td>${callloglist.callTime }</td>
<td><a href="/srg/callLog.do?method=viewCallLog&Id=${count}">详细</a></td>
</tr>
</c:forEach>就是想在“<a href="/srg/callLog.do?method=viewCallLog&Id=${count}">详细</a>”这里传一个列数过去&Id=${count}
是不是用varStatus属性里的count???????
1.current:当前这次迭代的(集合中的)项。
2.index:当前这次迭代从0开始的迭代索引。
3.count:当前这次迭代从1开始的迭代计数。
4.first:用来表明当前这轮迭代是否为第一次迭代,该属性为boolean类型。
5.last:用来表明当前这轮迭代是否为最后一次迭代,该属性为boolean类型。
6.begin:begin属性的值。
7.end:end属性的值
8.step:step属性的值
有四个值:count,index,first,last
一般用count和index,index是从索引0开始
${count}
<c:forEach>
我是这样用的${count}来显示的但是,显示出来的是
javax.servlet.jsp.jstl.core.LoopTagSupport$1Status@1295fe8
这个看都看不懂的东西怎么回事?望高手们指点。。
<c:forEach items="${callloglist}" var="callloglist" varStatus="count">
<tr>
<td align="center">${count}</td> 在这一行显示我这里用${count}显示出来的是javax.servlet.jsp.jstl.core.LoopTagSupport$1Status@1295fe8 ,怎样才是正确的,能不能帮我指正下3Q了~~~
<td align="center">${callloglist.callType }</td>
</tr>
</c:forEach>
<c:forEach items="${services}" var="service" varStatus="statu">
<tr>
<td align="center" vAlign="center">${statu.index+1}</td>
<td align="center" vAlign="center">${service.msName}</td>
</tr>
</c:forEach>
</c:if>
虽然count属性可以,我更喜欢用index,感觉这个表里合一,用count每次都让我产生误解,总让我认为是总数,但是用index,还要多用一次加法。自己看着办吧!