velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <...@xyris.com>
Subject RE: ArrayList Failure
Date Tue, 13 Feb 2001 17:24:58 GMT
 From: Ivan [mailto:ivan@buc.com]

> Christoph's note of Jan 24 says that I can use an array defined in the
> template, but I haven't been successful.

[snip]

Here is what I was able to do just now :

My template :

#set($arr = ["a","b","c"])
#set($foo = 1)

$arr.get(1)
$arr.get($foo)
$arr.get($one)
$arr.get($provider.getInt() )
$arr.get($provider.getInteger() )
$arr.get($provider.int )
$arr.get($provider.integer)

Where in my test program :

   context.put("one", new Integer(1) );

and in the test provider (see org.apache.velocity.test.misc and environs...)

 public int getInt()
 {
  return 1;
 }

 public Integer getInteger()
 {
  return new Integer(1);
 }


my output :


b
b
b
b
b
b
b

So things seem fine.  This was done with the 20010213 nightly snapshot under
WinNT w/ jdk1.3

Take a look and see what the return type of '$query.cond' is....

geir




Mime
View raw message