<c:set var="routes" value="${pageScope['routesKey']}"/>
- or -
<c:set var="routes" value="${requestScope['routesKey']}"/>
- or -
<c:set var="routes" value="${sessionScope['routesKey']}"/>
- or -
<c:set var="routes" value="${applicationScope['routesKey']}"/>
<c:forEach values="${routes}" var="route">
<!-- Iterate over routes -->
Route ID: <c:out value="${route.id}"/><br>
<c:forEach values="${route.segments}" var="segment">
<!-- Iterate over segments -->
Segment ID: <c:out value="${route.id}"/><br>
</c:forEach>
</c:forEach>
(I don't know if your routes/segments have an id property - it's just an
example)
I'm reasonably certain this should work. I use basically the same
construct to go over an ArrayList (exposed as a Collection) and it's
nested ArrayList (again, exposed as a Collection).
Michael Bowman wrote:
>I am trying to nest iterate tags. I've tried <logic:iterate> <nested:iterate> and
><c:forEach> without success. Here's what I want to do.
>
><logic:iterate name="routes" id="route" type="RouteBean">
> write stuff about the route.
> <logic:iterate name="route" property="segments" id="segment" type="SegmentBean">
> write stuff about the segment
> </logic:iterate>
></logic:iterate>
>
>"routes" points to a java.util.List of RouteBeans. Each RouteBean has a method,
>getSegments() that returns a java.util.List of SegmentBeans.
>
>I've looked at the documents and examples for the nested tag, but I don't see
>anything about this type of nesting. I don't have a "monkey" with a single "bunch" of
>bananas, instead I simply have a java.util.List of bunches, each of which has a
>java.util.List of bananas.
>
>I'd really appreciate any help ya'll can give me. I'm up for using any tag type
>(struts-logic, struts-nested, or JSTL). I'd just rather not fall back on scriptlets
>if I can help it.
>
>Thanks,
>Michael Bowman
>
--
Eddie Bush
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>