关于以下错误的任何想法是???
JSP Can't find resource for bundle java.util.PropertyResourceBundle, key el.convert
我在使用jsp时得到了这个。我错过了一些东西吗?
<c:set var="count" value="0" scope="page" />
<c:forEach items="${usersList}" var="userNames" >
<c:set var="counter" value="${count + 1}" scope="page"/>
<li class="msImages">
<c:choose>
<c:when test="${counter lt '4'}">
<p> <span> I am creating an image</span>
</p>
</c:when>
<c:when test="${counter eq '4'}">
<span>See More </span>
</c:when>
</c:choose>
</li>
答案 0 :(得分:3)
您使用相同的变量名称count
两次。删除<c:set var="count" value="0" scope="page" />
。此外,您应该使用varStatus
的属性,而不是直接使用值。 It's not a primitive object.
<c:forEach items="${usersList}" var="userNames" varStatus="stat">
<c:set var="counter" value="${stat.count + 1}" scope="page"/>
<li class="msImages">
<c:choose>
<c:when test="${counter lt 4}">
<p> <span> I am creating an image</span> </p>
</c:when>
<c:when test="${counter eq 4}">
<span>See More </span>
</c:when>
</c:choose>
</li>
</c:forEach>