System.out.println()可以很方便地标记一段代码是否被执行。当然,我们也可以打印出各种各样的值。
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head><title>System.out.println</title></head>
<body>
<c:forEach var="counter" begin="1" end="10" step="1" >
<c:out value="${counter-5}"/></br>
<% System.out.println( "counter= " + pageContext.findAttribute("counter") ); %>
</c:forEach>
</body>
</html>
输出:
要获取更多Jerry的原创文章,请关注公众号"汪子熙":