You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Mark Stang <ms...@pingidentity.com> on 2005/08/25 21:20:30 UTC
Printing out a map with a Foreach
What is the easiest way to iterate through a map and print the key and the value?
thanks,
Mark
Re: Printing out a map with a Foreach
Posted by Geoff Longman <gl...@gmail.com>.
On 8/25/05, Geoff Longman <gl...@gmail.com> wrote:
> <span jwcid="loop@Foreach" source="ognl:myMap.values">
actually,
<span jwcid="loop@Foreach" source="ognl:myMap.entrySet()">
>
> <span jwcid="@Insert" value="ognl:components.loop.value.key" /><br>
> <span jwcid="@Insert" value="ognl:components.loop.value.value"/>
>
> </span>
>
> On 8/25/05, Mark Stang <ms...@pingidentity.com> wrote:
> > What is the easiest way to iterate through a map and print the key and the value?
> >
> > thanks,
> >
> > Mark
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
>
>
> --
> The Spindle guy. http://spindle.sf.net
> Get help with Spindle:
> http://lists.sourceforge.net/mailman/listinfo/spindle-user
> Announcement Feed:
> http://www.jroller.com/rss/glongman?catname=/Announcements
> Feature Updates: http://spindle.sf.net/updates
>
--
The Spindle guy. http://spindle.sf.net
Get help with Spindle:
http://lists.sourceforge.net/mailman/listinfo/spindle-user
Announcement Feed:
http://www.jroller.com/rss/glongman?catname=/Announcements
Feature Updates: http://spindle.sf.net/updates
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Printing out a map with a Foreach
Posted by Geoff Longman <gl...@gmail.com>.
<span jwcid="loop@Foreach" source="ognl:myMap.values">
<span jwcid="@Insert" value="ognl:components.loop.value.key" /><br>
<span jwcid="@Insert" value="ognl:components.loop.value.value"/>
</span>
On 8/25/05, Mark Stang <ms...@pingidentity.com> wrote:
> What is the easiest way to iterate through a map and print the key and the value?
>
> thanks,
>
> Mark
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
--
The Spindle guy. http://spindle.sf.net
Get help with Spindle:
http://lists.sourceforge.net/mailman/listinfo/spindle-user
Announcement Feed:
http://www.jroller.com/rss/glongman?catname=/Announcements
Feature Updates: http://spindle.sf.net/updates
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Printing out a map with a Foreach
Posted by Konstantin Ignatyev <kg...@yahoo.com>.
Perhaps
for( Map.Entry entry:
(Set<Map.Entry>)someMap.entrySet() ){
System.out.println( entry.getKey() +"=" +
entry.getValue() ) ;
}
--- Mark Stang <ms...@pingidentity.com> wrote:
> What is the easiest way to iterate through a map and
> print the key and the value?
>
> thanks,
>
> Mark
>
> >
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
tapestry-user-help@jakarta.apache.org
Konstantin Ignatyev
PS: If this is a typical day on planet earth, humans will add fifteen million tons of carbon to the atmosphere, destroy 115 square miles of tropical rainforest, create seventy-two miles of desert, eliminate between forty to one hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of CFCs to the stratosphere, and increase their population by 263,000
Bowers, C.A. The Culture of Denial: Why the Environmental Movement Needs a Strategy for Reforming Universities and Public Schools. New York: State University of New York Press, 1997: (4) (5) (p.206)
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org