You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rick Mann <rm...@latencyzero.com> on 2003/05/07 03:22:41 UTC

Using nested:iterate without nested:root or form?

I'm sure this is a common problem, but searching the archives for things
like "nested root collection" didn't seem to turn up any answers.

On many occasions I've come across the need to iterate over a Collection of
objects in a JSP. The action creates the collection of objects, stuffs it
into the session (or request, or whatever), and then I want to use
<nested:iterate> to go over them in the JSP.

There is no form in the JSP, and there is no single bean that ties all the
session attributes together.

I'd like to just start by saying:

<nested:iterate name="myattribute" id="item">
</nested:iterate>

but this doesn't seem to work. Is it absolutely necessary to start a nesting
hierarchy with nested:root or nested:form? Why? Couldn't nested:iterate be
smart enough to start the hierarchy if a "name" attribute was specified?
Perhaps it is, and I'm doing something else wrong, but it seems to work fine
if I use the <logic:iterate> version and specify the beans explicitly in
enclosed tags.

TIA,

-- 
Rick


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