<c:forEach>循环获取下一次循环数据
实现案例类似于多级导航栏下拉。双循环便利ul、li,利用外层循环的index获取数据、动态id设置。
varLista[vs.index][livs.index+1].DEPTNAME 可以获取当前循环相邻的数据
<div class="logodiv" id="dw1" >
<ul class="ul1">
<c:forEach items="${arrs }" var="arrs1" varStatus="vs">
<li onmouseover="liin1(this.id)" id="li${ vs.index+1}">
<a href="">${arrs[vs.index] }</a>
<ul class="ul11" id="ul1${ vs.index+1}">
<c:forEach items="${varLista[vs.index]}" var="vars" varStatus="livs" step="3">
<li>
<a onclick="change1('${vars.DWNAME }','${vars.DEPTNAME }');">${vars.DEPTNAME }</a>
<a onclick="change1('${vars.DWNAME }','${varLista[vs.index][livs.index+1].DEPTNAME }');">${varLista[vs.index][livs.index+1].DEPTNAME }</a>
<a onclick="change1('${vars.DWNAME }','${varLista[vs.index][livs.index+2].DEPTNAME }');">${varLista[vs.index][livs.index+2].DEPTNAME }</a></li>
</c:forEach>
</ul>
</li>
</c:forEach>
</ul>
</div>