cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Anderson <benanderson...@gmail.com>
Subject <jx:forEach items="${[java.util.Map]}"
Date Tue, 14 Feb 2006 15:47:04 GMT
Hi,
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
jstl.

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

Thanks,
Ben

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message