Taglib provides a support for the very often used
operations: getting the first (the last or the random) element from the given collection.
For example:
You can directly provide your collection for the tag or pass a name for your bean in a page (request, session or application) scope.
Tags are:
getFirst
Tag requests the first element from the given collection. Parameters are:
1) source Optional parameter. Describes a collection, iterator, enumeration or array
2) name Optional parameter. Describes a name for your bean in a page (request, session
or application) scope.
3) id Optional parameter. Describes a name for the
page scope variable for data (type is java.lang.Object). Without
this parameter tag just prints data.
getLast
Tag requests the last element from the given collection. Parameters are:
1) source Optional parameter. Describes a collection, iterator, enumeration or array
2) name Optional parameter. Describes a name for your bean in a page (request, session
or application) scope.
3) id Optional parameter. Describes a name for the
page scope variable for data (type is java.lang.Object). Without
this parameter tag just prints data.
getRandom
Tag requests the random element from the given collection. Parameters are:
1) source Optional parameter. Describes a collection, iterator, enumeration or array
2) name Optional parameter. Describes a name for your bean in a page (request, session
or application) scope.
3) id Optional parameter. Describes a name for the
page scope variable for data (type is java.lang.Object). Without
this parameter tag just prints data.
for downloading:
Library: firsttag.jar Description: taglib.tld
See also Coldtags suite - the largest collection of custom JSP tags.