You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by tm...@apache.org on 2006/04/16 12:17:05 UTC
svn commit: r394450 -
/incubator/webwork2/action/src/main/java/org/apache/struts/action2/components/IteratorComponent.java
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 (rsal@mb.sympatico.ca)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org