I was following this jstl tutorial.
I am trying to print values in a c:forEach
loop, but the value for i
is not being printed.
My code:
<%--
Created by IntelliJ IDEA.
User: Jaideep Shekhar
Date: 25.11.2020
Time: 15:00
To change this template use File | Settings | File Templates
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core" %>
<html>
<body>
<c:forEach var="i" begin="0" end="10">
<h1><c:out value="${i}"/></h1>
</c:forEach>
</body>
</html>
The output is:
${i}
${i}
${i}
${i}
${i}
${i}
${i}
${i}
${i}
${i}
${i}
Any help appreciated!