|
The repeat define loop that controls the rendering of a repeat region. A collection is also defined, a member object of which is presented in every iteration of the loop.
Example definition is shown below.
BEHAVIOR DESCRIPTORS |
id |
type |
data-source |
value |
define-id |
define-class |
define-scope |
details |
| bookList |
repeat |
{bookForm.list} |
10,0,1 |
book |
|
|
|
The class definition is deduced automatically through java inspections, as such the entry for define-class is
not necessary, as far asimplementation is concerned.The scope is limited to the body of the repat tag; scope specification would be meaningless.
The implementation of this specification is as follows.
<logic:iterate name="bookForm" property="#{list}"
id="book" offset="0" length="10" <
</logic:iterate>
The implementation using JSTL tag is illustrated below.
<c:forEach items=="#{bookForm.list}"
var="book" begin="0" end="10" step="1"<
</c:forEach>
The transformation of the specification to Struts and JSTL tags is shown below.
| Descriptor Attribute | Struts-logic:iterate | JSTL-c:forEach |
| data-source | name/property | items |
| define-id | id | var |
| define-class | type | |
| value:O | offset | begin |
| value:N | length | end |
| value:Step | | step |
More details are available in the attributes descriptions
type
id
data-source
value
define-id
define-class
define-scope
|