struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve" <sms...@neca.com>
Subject Multiple <logic:iterate> still unclear
Date Mon, 16 Sep 2002 12:52:51 GMT
I am still unclear as to how to use multiple <logic:iterate> tags. Can
anyone shed some light on this for me. I currently have the following in
my .jsp:

<logic:iterate  id="aBook" name="allBooks">
    <bean:write name="aBook" property="id"/><br>
    <bean:write name="aBook" property="desc"/><br>
    <logic:iterate id="aAuthor" name="allAuthors">
       <bean:write name="aAuthor" property="authorIds"/><br>
    </logic:iterate>
</logic:iterate>

allBooks is a collection of Book beans. The Book bean has the
appropriate getters and setters, where the getAuthorIds returns a List.
With the current markup my output is this:

1
Book 1 desc
[10, 20, 30, 40]
[10, 20, 30, 40]
[10, 20, 30, 40]
[10, 20, 30, 40]

I am currently working with just 4 books, so it would seem that the
nested <logic:iterate> is iterating over the number of books as opposed
to the number of elements in the authorIds List. I have searched the
archives and still can not seem to get this straight. I simply want to
display:

1
Book 1 desc
10
20
30
40

What should my syntax for the inner <logic:iterate> resemble? Or am I
doing something else fundamentally wrong?

Tia.

steve


 


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message