Reputation: 123
<c:set var="secCount" value="${0}">
<c:if test="${readaccess || empty param.id}">
<div class="row profile-data">
<div class="column large-3 medium-6 small-12 gry-txt">
<fmt:message key="profileView.secondarySkill" />
</div>
<div class="column large-9 medium-6 small-12">
<c:choose>
<c:when test="${not empty employeeDTO.companyDetailsDTO.skillDTO}">
<tr>
<c:forEach items="${employeeDTO.companyDetailsDTO.skillDTO}" var="skill">
<c:if test="${skill.skillTypeDTO.code=='SEC'}">
<c:set var="secCount" value="${ secCount+1}"/>
<td>${skill.skillNameDTO.name}</td>
</c:if>
</c:forEach>
<c:if test="${ secCount==0}">
<td>-</td>
</c:if>
</tr>
</c:when>
<c:otherwise>
-
</c:otherwise>
</c:choose>
</div>
</div>
</c:if>
</c:set>
I want to ask that it is the right way to declare a integer and increment it just because I am getting this error
867: Encountered illegal body of tag "c:set" tag, given its attributes.
908: Encountered illegal body of tag "c:set" tag, given its attributes.
Upvotes: 1
Views: 6578
Reputation: 58792
Change to the following code:
<c:set var="secCount" value="0" scope="page" />
...
<c:set var="secCount" value="${secCount + 1}" scope="page"/>
Upvotes: 3