Single Page


The forEach Attribute

forEach="${an-EL-expr}"forEach="${an-EL-expr},a-value"

There are two formats. First, you specify a value without comma. The value is usually a collection of objects, such that the associated element will be evaluated repeatedly against each object in the collection. If not specified or empty, this attribute is ignored. If non-collection object is specified, it is evaluated only once as if a single-element collection is specified.

Second, you can specify a list of values by separating them with comma. Then, the assoicated element will be evaluated repeatedly against each value in the list.