struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Victor CHEVALIER" <>
Subject RE: Multiple <logic:iterate> still unclear
Date Mon, 16 Sep 2002 13:02:02 GMT
I think you should write in the second iterate :

<logic:iterate id="aAuthor" name="aBook" property="authorIds">

this means you iterate through the authors of aBook.

-----Message d'origine-----
De : Steve []
Envoye : lundi 16 septembre 2002 14:53
A :
Objet : Multiple <logic:iterate> still unclear

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>

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:

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

Book 1 desc

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



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

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

View raw message