tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (David M. Karr)
Subject Re: [standard] nested forEach tags?
Date Sat, 23 Nov 2002 18:26:52 GMT
>>>>> "Wendy" == Wendy Smoak <> writes:

    Wendy> Can you nest <c:forEach> tags?  I can't find an example of it, and it's
    Wendy> working for me.

    Wendy> <c:forEach items="${itemList}" var="item">
    Wendy>       <hr>
    Wendy>       <c:out value="${}"/>. <c:out value="${item.text}"/><br>
    Wendy>       <c:forEach items="${item.options}" var="option" />
    Wendy>          <c:out value="${option.text}"/>
    Wendy>       </c:forEach>
    Wendy>       <c:out value="${item.answer}"/><br>
    Wendy> </c:forEach>

    Wendy> The first </c:forEach> tag ends the loop.

    Wendy> Should this be working?  Does anyone see anything wrong with this?

The typo you refer to is in the first "<c:forEach>".  The line ends with "/>".
That's why the second "</c:forEach>" ended up in the output.

David M. Karr          ; Java/J2EE/XML/Unix/C++   ; SCJP

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

View raw message