struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Hilterbrand" <>
Subject Re: Newbie and use of <logic:iterate>
Date Fri, 13 Sep 2002 23:07:16 GMT
Try this:

    <logic:iterate id="sid" name="allFoo" property="someIds">
        <bean:write name="sid" property="id"/>

"someIds" is a Collection of beans.  "id" property on an individual bean.
This will work with arrays also, but then you have to specify the type
in the logic:iterate tag.


----- Original Message -----
From: "Steve" <>
To: <>
Sent: Friday, September 13, 2002 2:54 PM
Subject: Newbie and use of <logic:iterate>

Not sure this posted the first time. Sorry in advance if it did.

I have checked the archives and I can still not seem to find a clear way
of how to accomplish the following. I have a collection of beans added
to the request:

request.setAttribute("allFoo", foos);

The beans have a property called 'someIds'( this is a List of id's) ,
along with other properties like name, desc, etc. In my .jsp I simply
need to iterate over the collection of beans displaying the properties
and where applicable iterate over 'someIds'. I have something similar to
this currently:

<logic:iterate name="allFoo" id="aFoo">
    <bean:write name="aFoo" property="title"/>
    <bean:write name="aFoo" property="name"/>
    <bean:write name="aFoo" property="desc"/>
    <logic:iterate name="allFoo" id="sid">
        <bean:write name="sid" property="someIds"/>

This does not give me the desired result though. Can someone shed some
light on what it is I am doing incorrectly? It seems like a fairly
common thing that I want to do.



To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message