cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Anderson <>
Subject <jx:forEach items="${[java.util.Map]}"
Date Tue, 14 Feb 2006 15:47:04 GMT
I'm need to iterate over a map and have access to both the keys and
values.  I was hoping for something like like:

        <jx2:forEach items="${pages}" var="p">
          <page key="${p.key}" value="${p.value}""/>

This doesn't work.  What I've found is that the variable p actually
has the value in it.

So, instead of java.util.Map.entrySet().iterator() being called to do
the iteration, it seems as if java.util.Map.getValues().iterator() is
called to do this iteration behind the scenes.  This is in contrast to

Anyways, does anyone know a way to get the key?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message