martinc 01/06/15 14:48:47 Modified: web/exercise-taglib Tag: STRUTS_1_0_BRANCH logic-iterate.jsp Log: Update the iterate tests to display the index value as obtained via the new indexId attribute. Revision Changes Path No revision No revision 1.3.2.1 +16 -14 jakarta-struts/web/exercise-taglib/logic-iterate.jsp Index: logic-iterate.jsp =================================================================== RCS file: /home/cvs/jakarta-struts/web/exercise-taglib/logic-iterate.jsp,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -r1.3 -r1.3.2.1 --- logic-iterate.jsp 2001/04/11 01:56:12 1.3 +++ logic-iterate.jsp 2001/06/15 21:48:46 1.3.2.1 @@ -29,59 +29,61 @@ <h3>Test 1 - Iterate Over A String Array [0..4]</h3> <ol> -<logic:iterate id="element" name="bean" property="stringArray"> - <li><em><bean:write name="element"/></em></li> +<logic:iterate id="element" name="bean" property="stringArray" indexId="index"> + <li><em><bean:write name="element"/></em> [<bean:write name="index"/>]</li> </logic:iterate> </ol> <h3>Test 2 - Iterate Over A String Array [0..2]</h3> <ol> -<logic:iterate id="element" name="bean" property="stringArray" length="3"> - <li><em><bean:write name="element"/></em></li> +<logic:iterate id="element" name="bean" property="stringArray" indexId="index" + length="3"> + <li><em><bean:write name="element"/></em> [<bean:write name="index"/>]</li> </logic:iterate> </ol> <h3>Test 3 - Iterate Over A String Array [3..4]</h3> <ol> -<logic:iterate id="element" name="bean" property="stringArray" offset="3"> - <li><em><bean:write name="element"/></em></li> +<logic:iterate id="element" name="bean" property="stringArray" indexId="index" + offset="3"> + <li><em><bean:write name="element"/></em> [<bean:write name="index"/>]</li> </logic:iterate> </ol> <h3>Test 4 - Iterate Over A String Array [1..3]</h3> <ol> -<logic:iterate id="element" name="bean" property="stringArray" +<logic:iterate id="element" name="bean" property="stringArray" indexId="index" offset="1" length="3"> - <li><em><bean:write name="element"/></em></li> + <li><em><bean:write name="element"/></em> [<bean:write name="index"/>]</li> </logic:iterate> </ol> <h3>Test 5 - Iterate Over an Array List</h3> <ol> -<logic:iterate id="item" name="list"> - <li><em><bean:write name="item"/></em></li> +<logic:iterate id="item" name="list" indexId="index"> + <li><em><bean:write name="item"/></em> [<bean:write name="index"/>]</li> </logic:iterate> </ol> <h3>Test 6 - Iterate Over an Array List [0..2]</h3> <ol> -<logic:iterate id="item" name="list" +<logic:iterate id="item" name="list" indexId="index" offset="0" length="3"> - <li><em><bean:write name="item"/></em></li> + <li><em><bean:write name="item"/></em> [<bean:write name="index"/>]</li> </logic:iterate> </ol> <h3>Test 7 - Iterate Over an Array List [2..4]</h3> <ol> -<logic:iterate id="item" name="list" +<logic:iterate id="item" name="list" indexId="index" offset="2" length="3"> - <li><em><bean:write name="item"/></em></li> + <li><em><bean:write name="item"/></em> [<bean:write name="index"/>]</li> </logic:iterate> </ol>