<c:set var="index" value="0" />
<c:forEach items="${cause}" var="c" varStatus="status">
<c:set var="index" value="${index+1}" />
<c:set var="id" value="title${index}" />
请问这样设置变量用thymleaf可以实现么
<c:set var="index" value="0" />
<c:forEach items="${cause}" var="c" varStatus="status">
<c:set var="index" value="${index+1}" />
<c:set var="id" value="title${index}" />
请问这样设置变量用thymleaf可以实现么
原来thymleaf的th:each自带下列属性,可以直接使用,之前以为不能这么用