c_foreach_2.jsp
来自「《精通JSP编程 》源代码(赵强那本) 很有用的源代码」· JSP 代码 · 共 27 行
JSP
27 行
<%@ page contentType="text/html;charset=GB2312" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title> c_forEach2.jsp</title>
</head>
<body>
<h2><c:out value="<c:forEach> begin、end和step的用法" /></h2>
<%
String values[] = new String [3];
values[0]="hello";
values[1]="JSP";
values[2]="world";
request.setAttribute("values", values);
%>
<c:forEach items="${values}" var="item" begin="0" end="2" step="1">
${item}</br>
</c:forEach>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?