JSTL LOOP - 计数器+ = 3增量 [英] JSTL LOOP - counter +=3 Increment
本文介绍了JSTL LOOP - 计数器+ = 3增量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须在JSTL中迭代一个集合,但我希望索引每个循环增加+3,类似于
I have to iterate a collections in JSTL, but I would like the index to be incremented +3 each loop, something like
for (int i=0; i<50; i+=3) {
}
但是在JSTL
推荐答案
使用< c:forEach />
作为的替代品存在的标签,而
, do-while
和中的循环jstl
通过 scriptlet
<c:forEach var="i" begin="0" end="50" step="3" >
<c:out value="${i}"/>
</c:forEach>
开始
进行初始化,结束
用于终止,步骤
用于增加
begin
for initialization, end
for termination and step
for increment
这篇关于JSTL LOOP - 计数器+ = 3增量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文