jsp的foreach问题
假设styles是list,值为【b1,b2】
代码为:
<c:forEach var="style" items="${styles }" varStatus="stylesLoopCount"> <br> &{stylesLoopCount.count }${style } </c:forEach> ${styles } <c:forEach var="style" items="${styles }" varStatus="stylesLoopCount"> <br> ${stylesLoopCount.index} </c:forEach><!-- 绝对可以了,哪里的问题你应该知道了 -->
[解决办法]
迭代取值的时候,你把 $ 写成了 &
[解决办法]
<c:forEach var="style" items="${styles }" varStatus="stylesLoopCount">
是不是红色字体部分多了一个空格?
[解决办法]
- - 悲剧。 <logic:iterate id="idx" name="${style}"> ${idx}</logic:iterate>