tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "louis@ironpulse.com" <lo...@ironpulse.com>
Subject Re: looping/ iterating over a collection ina a collection
Date Wed, 12 Feb 2003 01:50:38 GMT
> 
> 
> louis@ironpulse.com wrote:
> 
> >for some reason i am unable to loop over a collection in a coolection
for example:
> >
> >i have a class with a field called "basket" which is a collection of
"Items" which contains a field called "contents".
> >
> >for some reason i am unable to access the the contents in Item with the
follwing code:
> >
> ><c:out value=${sessionScope.Cart.basket[0].content[0].name} />
> >
> >or 
> >
> ><c:forEach items="${sessionScope.Cart.basket}" var=i >
> >  <c:forEach items="${sessionScope.Cart.basket[i].contents}" var="x">
> >    <c:out value="${x.name}"/>
> >  </c:forEach>
> ></c:forEach>
> >
> I believe the following code will work:
> 
> |<c:forEach items="${sessionScope.Cart.basket}" var=i >
> <c:forEach items="${i.contents}" var="x" >
> <c:out value="${x.name}" />
> </c:forEach>
> </c:forEach>|
> 
> 
> Jefferson Andrade
> 
> i thought it should work but for some reason it doesnt


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


Mime
View raw message