cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Molnar <>
Subject JXTemplate forEach assigns entire list to current
Date Sat, 19 Feb 2011 14:52:31 GMT
Hi all,

I have a forEach tag in my template, which behaves oddly. The variable 
comes from an InputModule, which returns a List<String>, then it is 
referenced as a parameter in the sitemap, which is passed to the 
jxtemplate transformer. I would like to print each string as a line on 
the output.

However, when I print #{.}, it prints the entire list, and the loop 
quits after one iteration, regardless of the size of the list. When I 
try Jexl syntax, it doesn't print anything. I am clueless.

Output is like this:

[value1, value2, ... ]

Here's the sitemap:

<map:match pattern="report.html">
   <map:generate type="jx" src=".../templates/report.xhtml">
     <map:parameter name="initSources" value="{skarabExt:initSources}"/>
   <map:serialize type="html"/>

Here is the template:

<jx:forEach select="#{$cocoon/parameters/initSources}" varStatus="status">
   <jx:out value="#{$status/current}"/>

I am using cocoon 2.2.0 and cocoon-template-impl 1.1.0 from Maven.

Thanks in advance!


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

View raw message