Use JSTL forEach loop's varStatus as an ID

后端 未结 4 1670
悲哀的现实
悲哀的现实 2020-12-07 11:49

I want to use the count from the JSTL forEach loop, but my code doesnt seem to work.



        
4条回答
  •  不知归路
    2020-12-07 12:21

    The variable set by varStatus is a LoopTagStatus object, not an int. Use:

    To clarify:

    • ${theCount.index} starts counting at 0 unless you've set the begin attribute
    • ${theCount.count} starts counting at 1

提交回复
热议问题