Struts2 iterator tag (Control tag)
Usage:
Iterator tag is used to iterate over the collection of values.
It has two attributes
value:
It is mandatory. It has object type. In this attribute you can specify the object to be loop over.
status:
It is not mandatory. It's type is String. If this is specified then it will exponse the IteratorStatus object in the actionContext under the value given to this attribute.
Example:
<s:iterator value="birds" status="counter">
<li>
<s:property value="#counter.count" />
<s:property value="birdName"/>
</li>
</s:iterator>
The iteratorStatus has following method
getCount(), getIndex(), isEven(), isFirst(), isLast(), isOdd(), modulus(int operand)
Iterator tag is used to iterate over the collection of values.
It has two attributes
value:
It is mandatory. It has object type. In this attribute you can specify the object to be loop over.
status:
It is not mandatory. It's type is String. If this is specified then it will exponse the IteratorStatus object in the actionContext under the value given to this attribute.
Example:
<s:iterator value="birds" status="counter">
<li>
<s:property value="#counter.count" />
<s:property value="birdName"/>
</li>
</s:iterator>
The iteratorStatus has following method
getCount(), getIndex(), isEven(), isFirst(), isLast(), isOdd(), modulus(int operand)