jsp 中 foreach 獲取元素下標


<c:forEach items="${signBusList}" var="sign" varStatus="xh"> 

       ${xh.count}序號從1開始 

      ${xh.index}序號從0開始 

      ${xh.last}最后一個序號 

     ${xh.first}第一個序號 

</cforEach>

var代表當前變量.

varStatus代表當前變量的狀態,其中包含了index,count等屬性.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM