首页 > 解决方案 > c:out 标签不打印值

问题描述

我正在关注这个jstl 教程。
我正在尝试c:forEach循环打印值,但未打印值i

我的代码:

<%--
    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>

输出是:

${i}
${i}
${i}
${i}
${i}
${i}
${i}
${i}
${i}
${i}
${i}

任何帮助表示赞赏!

标签: jspjstlel

解决方案


推荐阅读