JSTL Early Access | Beware API and Tags may/will change | support development comments to JSR052 EG |
JSTL Examples Introduction EL Support Conditionals Iterators Import I18N & Formatting XML SQL Misc. |
toString()
value of the items in the
Customers
collection.Another simple example. Similar to the previous one, except that in this case
there is no collection to iterate over. The items
attribute is
optional in the <forEach>
tag. When it is not specified,
the range attributes must be used to iterate a specific number of times over
the tag's body. In this example, we simply iterate over the integer values specified
by the range attributes.
The <forEach>
tag supports a large number of data types
for the collection of objects to iterate over. In this example, we feature the
following data types: array of primitives, array of objects, Enumeration, Properties
(Map), String (Comma Separated Values).
The iterator tag exposes a wealth of information relative to the iteration taking place. This example features some of that status information.
The iterator tags expose interface IteratorTag to allow custom tags to establish implicit collaboration. This example shows two custom tags, <even> and <odd> who take advantage of this implicit collaboration.
The <forEach> tag provides the basic iteration capabilities. <forTokens> is a specialization for the handling of Strings of tokens. Essentially the same as <forEach>, except that it only applies to Strings of tokens and that it has an extra attribute "delims" to specify the token delimiter.
JSTL exposes in its API the abstract class IteratorTagSupport to facilitate the implementation of custom iterator tags that leverage the standard iteration behavior defined in JSTL. This example shows a custom iterator tag that ...
JSTL Early Access | Beware API and Tags may/will change | support development comments to JSR052 EG |