commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Strachan <james_strac...@yahoo.co.uk>
Subject Re: [jelly] a bug? or am I missing something
Date Tue, 15 Apr 2003 23:54:13 GMT

On Tuesday, April 15, 2003, at 03:29  am, Warner Onstine wrote:

> Ok, I'm basically trying to duplicate some stuff from xsl land here 
> and am
> having some serious problems.
>
> Here's my jelly snippet:
> <x:set var="tables" select="database/table"/>
>
> <j:forEach indexVar="index" begin="1" end="${tables.size()}" step="1"
> items="${tables}" trim="no">
>     <x:set var="currentTable" select="/database/table/[$index]"/>
>     <j:set var="className"><x:expr
> select="$currentTable/@className"/></j:set>
>     <vel:merge name="${outputDir}/${className}Peer.php" 
> basedir="templates"
> readOnly="true" template="classes/peer.vm"/>
>     <vel:merge name="${outputDir}/Base${className}.php" 
> basedir="templates"
> readOnly="true" template="classes/base.vm"/>
> </j:forEach>
>
> Now, here's the problem I am running into:
> 55 [main] ERROR parser.XMLParser  - Caught exception:
> org.apache.commons.jelly.JellyException: null:-1:-1: <null> 
> Encountered ".
> size" at line 1, column 7.
> Was expecting one of:
> ------------
> Now, through all the examples I've read this should work. $tables is an
> ArrayList and has the method size().
>
> Any reason why this isn't working?


This is an unfortunate bug in Jexl. As a work around you can use the 
expression size(foo)

e.g.

> <j:forEach indexVar="index" begin="1" end="${size(tables)}" step="1"
> items="${tables}" trim="no">

James
-------
http://radio.weblogs.com/0112098/


Mime
View raw message