Of course, the object is pushed on the stack in every case (inside the scope of the iterator /bean tag) but , apart from that, the var/id attribute is used to place it (with that name!) in the ActionContext, and it will remain there even outside the tag scope, after it has been removed from the stack.
The docs seem (to me?) to imply that the name is used for pushing it onto the stack (which doesnt make sense). On Wed, Jan 21, 2009 at 5:58 PM, Dave Newton <newton.d...@yahoo.com> wrote: > (Forgot to add that the same is true for the bean tag as well.) > > Dave Newton wrote: >> >> hernan gonzalez wrote: >>> >>> The docs for the iterator tag, >>> http://struts.apache.org/2.0.11.2/docs/iterator.html >>> has an error, IMO (apart from the unfortunate confusion over the 'id' >>> vs 'var' attributes, which actually apply to struts 2.1) : >>> >>> It says: >>> >>> var : Name used to reference the value pushed into the Value Stack >>> >>> But, if I am not mistaken, the value is not 'pushed into the >>> ValueStack', but 'placed into the ActionContext'. >> >> Supplying the var/id attribute doesn't remove the stack push, it just adds >> the stack context reference. For example, from S2.0.11's IteratorComponent >> code: >> >> if ((iterator != null) && iterator.hasNext()) { >> Object currentValue = iterator.next(); >> stack.push(currentValue); >> >> String id = getId(); >> if ((id != null) && (currentValue != null)) { >> stack.getContext().put(id, currentValue); >> } >> //... >> >> >> Dave >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- Hernán J. González http://hjg.com.ar/ --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org