On 4/20/10 5:21 AM, Ganesh wrote:
I have a integer value and i have to show that many number of images. Could any one help me how to use the Counter tag.
More recent struts2 versions have more useful iterator use cases, so now you can just use begin, end, and step http://struts.apache.org/2.x/docs/iterator.html
If you're using 2.0 for some reason you can use an OGNL trick to get the result you're after: <http://www.opensymphony.com/ognl/html/LanguageGuide/coerceCollection.html> says "Members of java.lang.Number are "walked" by returning integers less than the given number starting with zero"
So if you have an OGNL expression %{#foo} that contains/results in the value 7, then the OGNL expression %{#foo.{#this}} will result in the list {0, 1, 2, 3, 4, 5, 6} over which you can iterate.
-Dale --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org