1 | <!-- |
---|
2 | Licensed to the Apache Software Foundation (ASF) under one or more |
---|
3 | contributor license agreements. See the NOTICE file distributed with |
---|
4 | this work for additional information regarding copyright ownership. |
---|
5 | The ASF licenses this file to You under the Apache License, Version 2.0 |
---|
6 | (the "License"); you may not use this file except in compliance with |
---|
7 | the License. You may obtain a copy of the License at |
---|
8 | |
---|
9 | http://www.apache.org/licenses/LICENSE-2.0 |
---|
10 | |
---|
11 | Unless required by applicable law or agreed to in writing, software |
---|
12 | distributed under the License is distributed on an "AS IS" BASIS, |
---|
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
14 | See the License for the specific language governing permissions and |
---|
15 | limitations under the License. |
---|
16 | --> |
---|
17 | <html> |
---|
18 | <head> |
---|
19 | <title>Tag Plugin Examples: forEach</title> |
---|
20 | </head> |
---|
21 | <body> |
---|
22 | <h1>Tag Plugin Examples - <c:forEach></h1> |
---|
23 | |
---|
24 | <hr> |
---|
25 | </br> |
---|
26 | <a href="notes.html">Plugin Introductory Notes<font <font color="#0000FF"></ |
---|
27 | a> |
---|
28 | <br/> |
---|
29 | <a href="howto.html">Brief Instructions for Writing Plugins<font color="#0000 |
---|
30 | FF"></a> |
---|
31 | <br/> <br/> |
---|
32 | <hr> |
---|
33 | |
---|
34 | <font color="#000000"/> |
---|
35 | </br> |
---|
36 | |
---|
37 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> |
---|
38 | <%@ page import="java.util.Vector" %> |
---|
39 | |
---|
40 | <h3>Iterating over a range</h3> |
---|
41 | <c:forEach var="item" begin="1" end="10"> |
---|
42 | ${item} |
---|
43 | </c:forEach> |
---|
44 | |
---|
45 | <% Vector v = new Vector(); |
---|
46 | v.add("One"); v.add("Two"); v.add("Three"); v.add("Four"); |
---|
47 | |
---|
48 | pageContext.setAttribute("vector", v); |
---|
49 | %> |
---|
50 | |
---|
51 | <h3>Iterating over a Vector</h3> |
---|
52 | |
---|
53 | <c:forEach items="${vector}" var="item" > |
---|
54 | ${item} |
---|
55 | </c:forEach> |
---|
56 | </body> |
---|
57 | </html> |
---|