【JSP开源代码栏目提醒】:网学会员JSP开源代码为您提供foreach1.jsp参考,解决您在foreach1.jsp学习中工作中的难题,参考学习。
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ page contentType="text/html; charset=gb2312" language="java" %>
<html>
<head>
<title>forEach标签实例一</title>
</head>
<body>
<center>
<h3>forEach标签迭代读取集合内容的使用实例</h3>
<%
String array[]=new String[5];
array[0]="welcome";
array[1]="to";
array[2]="here";
array[3]=":";
array[4]="wxm";
request.setAttribute("array",array);
%>
<c:forEach items="${array}" var="item" begin="0" end="4" step="1">
<p><c:out value="${item}"/></p>
</c:forEach>
</center>
</body>
</html>
上一篇:
foreach.jsp
下一篇:
还记得,那年的风车吗?