You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by chuanjiang lo <lo...@gmail.com> on 2006/03/14 13:28:29 UTC

Iterate nested ArrayList

I have a ArrayList of CustomerBean.
CustomerBean
Property:customer_name Type: String
Property:numbers            Type: ArrayList that stores Strings


In my Action class, i return the ArrayList through request scope.
request.setAttribute("CustomerList", customerList);

In my view, i have something,

<logic:iterate name="CustomerList" id="CustomerBean">
<bean:write name="CustomerBean" property="customer_name"/>

    <nested:root name="CustomerBean">
        <nested:iterate property="number">
            <td><How should i get the String stored in the number
ArrayList?></td>
        </nested:iterate>
    </nested:root>

</logic:iterate>


Sorry but i've tried searching through the mailing list but couldn't find an
answer to what i exactly want.
Thanks for any inputs!

Re: Iterate nested ArrayList

Posted by chuanjiang lo <lo...@gmail.com>.
Is it necessary for me to store numbers as another POJO in the ArrayList
rather than storing in as String?

On 3/14/06, chuanjiang lo <lo...@gmail.com> wrote:
>
> I have a ArrayList of CustomerBean.
> CustomerBean
> Property:customer_name Type: String
> Property:numbers            Type: ArrayList that stores Strings
>
>
> In my Action class, i return the ArrayList through request scope.
> request.setAttribute("CustomerList", customerList);
>
> In my view, i have something,
>
> <logic:iterate name="CustomerList " id="CustomerBean">
> <bean:write name="CustomerBean" property="customer_name"/>
>
>     <nested:root name="CustomerBean">
>         <nested:iterate property="number">
>             <td><How should i get the String stored in the number
> ArrayList?></td>
>         </nested:iterate>
>     </nested:root>
>
> </logic:iterate>
>
>
> Sorry but i've tried searching through the mailing list but couldn't find
> an answer to what i exactly want.
> Thanks for any inputs!
>