You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Per Jørgen Walstrøm <pe...@statnett.no> on 2005/11/24 14:46:58 UTC

Collection and logic:iterate

hello,
is the following true?

1) if I do a logic:iterate over a Collection when viewing the items in the Collection, I can use e.g. a HashSet
2) if I do a logic:iterate over a Collection and I want to be able to also update the items, I need to use an indexable Collection, e.g. an ArrayList. HashSet won't do.

cheers,
pj



Re: Collection and logic:iterate

Posted by Laurie Harper <la...@holoweb.net>.
Per Jørgen Walstrøm wrote:
> hello,
> is the following true?
> 
> 1) if I do a logic:iterate over a Collection when viewing the items in the Collection, I can use e.g. a HashSet
> 2) if I do a logic:iterate over a Collection and I want to be able to also update the items, I need to use an indexable Collection, e.g. an ArrayList. HashSet won't do.

Using an indexed collection will certainly make life easier, as Struts 
can then update the collection 'in place'. If you use a set, you'll have 
to reconstitute the entire set from the request parameters. Whether you 
*can* use a set depends on exactly how you're using it.

L.


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