Specify a value for the "varStatus" attribute:
<ui:repeat id="..." var="..." value="..." varStatus="myVarStatus">
You can then access the loop index via EL:
#{myVarStatus.index}
Additionally, the following properties are available to the varStatus:
- begin of type Integer
- end of type Integer
- index of type int
- step of type Integer
- even of type boolean
- odd of type boolean
- first of type boolean
- last of type boolean
For more details, see:
https://docs.oracle.com/javaee/7/javaserver-faces-2-2/vdldocs-facelets/ui/repeat.html
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…