struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Kiley" <jhki...@summa-tech.com>
Subject Re: [Struts 2] How to iterate to simple value ?
Date Fri, 30 May 2008 14:13:36 GMT
Read the example at the bottom of the URL I provided.  That is one
solution.  You may be able to come up with your own.  I encourage you to do
so if you are dissatisfied with that example.

On Fri, May 30, 2008 at 10:08 AM, Milan Milanovic <milanmilanovich@yahoo.com>
wrote:

> O.K.
>
> But is there any solution to this, besides putting that value into an array
> ?
>
> --
> Thx, Milan
>
> Jim Kiley <jhkiley@summa-tech.com> wrote: You can only iterate over an
> array or a Collection -- something that has an
> iterator() method.  Integers (and particularly ints) don't.  If you had
> looked up the iterator tag at
> http://cwiki.apache.org/WW/iterator.htmlbefore mailing the list, you
> would have seen at the bottom of the page an
> example of emulating a simple counter loop.
>
> That same page indicates that if you provide just a single non-iterable
> value, it will be placed into a List, which is subsequently iterated over.
> That is why you are seeing just your one value once.
>
> jk
>
> On Fri, May 30, 2008 at 9:58 AM, Milan Milanovic
> wrote:
>
> > Hi,
> >
> > I have one int (myInt) in my action class, and I want to iterate in my
> jsp
> > from 0 to that int (myInt), how can I do this ?
> >
> > I tried like this:
> >
> >
> >
> >
> >
> >
> >
> >
> > But it only writes its value, it doesn't iterate at all.
> >
> > --
> > Thx, Milan
> >
> >
>
>
>
>
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
>
>
>
>



-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message