struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "pls" <abenw...@hotmail.com>
Subject Re: iterate through a HashMap of Integer[]'s
Date Wed, 21 Apr 2004 20:42:52 GMT
thanks Bill!

"Bill Siggelkow" <billsigg@bellsouth.net> wrote in message
news:c666j3$3hs$1@sea.gmane.org...
> When you iterate through a map you are iterating through the Set of
> Map.Entry values.  The Map.Entry encapsulate a key-value pair.
> Map.Entry has a "key" property and a "value" property. In your case, the
> value itself is an Integer[].  Try the following:
>
> <logic:iterate id="mapEntry" name="myBean" property="myHashMap">
>     <logic:iterate id="intValue" name="mapEntry" property="value">
>       <bean:write name="intValue"/>
>    </logic:iterate>
> </logic:iterate>
>
> Bill Siggelkow
>
> news.gmane.org wrote:
>
> > myBean contains a property myHashMap
> > myHashMap contains Integer[]'s as values
> >
> > I would like to figure out how to iterate through myHashMap and write
each
> > Integer from each Integer[]
> >
> > I have the following but since the Integer[] is not a bean or a property
of
> > a bean, I can't figure out how to reference it or it's values.
> >
> >   <logic:iterate id="bean1" name="myBean" property="myHashMap">
> >      <logic:iterate id="bean2" name="bean1" property="Integer[]"
> > indexId="i">
> >         <bean:write property=Integer[${i}]/>
> >      </logic:iterate>
> >   </logic:iterate>
> >
> > thanks for your help in advance..




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


Mime
View raw message