Author: tmjee Date: Sun Apr 16 03:16:59 2006 New Revision: 394450 URL: http://svn.apache.org/viewcvs?rev=394450&view=rev Log: added an example more into the javadoc snippet
Modified: incubator/webwork2/action/src/main/java/org/apache/struts/action2/components/IteratorComponent.java Modified: incubator/webwork2/action/src/main/java/org/apache/struts/action2/components/IteratorComponent.java URL: http://svn.apache.org/viewcvs/incubator/webwork2/action/src/main/java/org/apache/struts/action2/components/IteratorComponent.java?rev=394450&r1=394449&r2=394450&view=diff ============================================================================== --- incubator/webwork2/action/src/main/java/org/apache/struts/action2/components/IteratorComponent.java (original) +++ incubator/webwork2/action/src/main/java/org/apache/struts/action2/components/IteratorComponent.java Sun Apr 16 03:16:59 2006 @@ -152,6 +152,29 @@ * * <!-- END SNIPPET: example4code --> * </pre> + * + * <!-- START SNIPPET: example5description --> + * + * </p>To simulate a simple loop with iterator tag, the following could be done. + * It does the loop 5 times. + * + * <!-- END SNIPPET: example5description --> + * + * <pre> + * <!-- START SNIPPET: example5code --> + * + * <a:iterator status="stat" value="{1,2,3,4,5}" > + * <!-- grab the index (start with 0 ... ) --> + * <a:property value="#stat.index" /> + * + * <!-- grab the top of the stack which should be the --> + * <!-- current iteration value (0, 1, ... 5) --> + * <a:property value="top" /> + * </a:iterator> + * + * <!-- END SNIPPET: example5code --> + * </pre> + * * * @author $Author$ * @author Rick Salsa ([EMAIL PROTECTED]) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]