Custom JSP tag. Lets you iterate execution over collections, iterators,
enumerations or arrays. For example:
<%@ taglib uri="taglib.tld" prefix="loop" %>
<%
java.util.Vector v=new java.util.Vector();
v.addElement("first");
v.addElement("second");
%>
<loop:iterate source="<%=v%>" id="A">
<br>Element: <%=A%>
</loop:iterate>
Also you can provide a name for the attribute in page (request, session, application)
scope that will be used as a source for the iteration.
Tags are:
iterate
Iterates over the given source. Parameters are:
1) source Optional parameter. Describes a collection, iterator, enumeration or array
2) name Optional parameter. Describes an attribute in page (request, session, application) scope that
keeps collection, iterator, enumeration or array.
3) id Optional parameter. Describes
a page scope variable (default type is java.lang.Object) you may use in the body as
a reference to the current element.
4) index Optional parameter. Describes
a page scope variable (type is java.lang.Integer) you may use in the body as
a reference to the current index.
5) type Optional parameter. Describes a type for page scope variable.
Default value is java.lang.Object.
6) from Optional parameter. Describes an initial index. Default value
is 1 (first element).
7) count Optional parameter. Limits iterations to the
first count entries only.
for downloading:
Library: looptag.jar Description: taglib.tld
© Coldbeans
Comments?
See also Coldtags suite - the largest collection of custom JSP tags.
|