you need to implement the Iterator interface

On Tue, May 10, 2011 at 4:14 PM, <matthieu.m...@ensam.eu> wrote:

> Hi everybody,
>
> I have a container object SearchResults which contains a treeMap of simple
> object SearchResult.
>
> I want to iterate over SearchResults in order to display properties of all
> SearchResult object
>
>        Class SearchResult {
>                //getter and setter
>                getDescription();
>        }
>
>        Class SearchResults {
>              treeMap<String, SearchResult>  resultats;
>
>                public Set<String> keyset();
>                public Iterator<String> iterator();
>                public SearchResult get(String key);
>        }
>
> My Action class have this getter :
>
>        getResultats(){ return (SearchResults)object; };
>
> And my JSP look like :
>
>        <s:iterator value="resultats">
>                <s:property value="description" />
>        </s:iterator>
>
>
> But it is not working, s:iterator tag is not iterating over my
> SearchResults object using the iterator() method (not called).
>
> How must I construct my SearchResults object in order to make the
> s:iterator tag iterate over it ?
>
> Thanks.
>
> Matthieu MARC
>
> ---
> Matthieu MARC
> Responsable du Service Informatique du Centre d'Angers
> Arts et Métiers ParisTech
> Tél : 02 41 20 73 61
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

Reply via email to