problem constructing "foreach" over primitive array

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

problem constructing "foreach" over primitive array

Mega Manfred
Hi All,

I can't seem to locate an example on how to address the items of a primitive array in a "foreach" structure.

With the statement below, I can iterate over the items within my array (if I put a static value within the foreach, then it gets iterated the amount of items within my array.)
But I cannot find the ognl syntax for adressing the items within my array. Can anybody help me on how this can be achieved.
Any response is very much appreciated. Thanks on beforehand!

<foreach item="item" index="index" separator="," collection="array">
#{item}
</foreach>
Reply | Threaded
Open this post in threaded view
|

Re: problem constructing "foreach" over primitive array

Mega Manfred
Sorry to bother you guys, I finally found it.
If this could be of any help for someone else ...

<foreach item="item" index="index" separator="," collection="array">
   ${array[index]}
</foreach>


On Sep 25, 9:25 pm, Mega Manfred <[hidden email]> wrote:

> Hi All,
>
> I can't seem to locate an example on how to address the items of a primitive
> array in a "foreach" structure.
>
> With the statement below, I can iterate over the items within my array (if I
> put a static value within the foreach, then it gets iterated the amount of
> items within my array.)
> But I cannot find the ognl syntax for adressing the items within my array.
> Can anybody help me on how this can be achieved.
> Any response is very much appreciated. Thanks on beforehand!
>
> <foreach item="item" index="index" separator="," collection="array">
> #{item}
> </foreach>