cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Anderson <benanderson...@gmail.com>
Subject Re: <jx:forEach items="${[java.util.Map]}" [SOLVED]
Date Tue, 14 Feb 2006 16:08:53 GMT
<jx2:forEach items="${pages.entrySet()}" var="p">

On 2/14/06, Ben Anderson <benanderson.us@gmail.com> wrote:
> 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