I would like to know where I go wrong, when I add the sum of 1 to 100 and display it using JSTL.
Here is my code:
<c:set var="sum" value="0" />
<c:forEach var="num" begin="1" end="100" varStatus="status">
${sum = sum + num}
</c:forEach>
<c:out value="${sum}" />
When I am trying to execute the above code, I am getting the following Exception:
> org.apache.el.parser.ParseException: Encountered " "= "" at line 1, column 7.
1 Answer