tomcat-taglibs-user mailing list archives

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

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

    Wendy> <c:forEach items="${itemList}" var="item">
    Wendy>       <hr>
    Wendy>       <c:out value="${item.id}"/>. <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++
dmkarr@earthlink.net   ; SCJP



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


Mime
View raw message