velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Lee <ag...@earthlink.net>
Subject Re: Passing in an array as a Java function argument?
Date Tue, 19 Nov 2002 20:07:46 GMT
At 11:50 AM -0800 11/19/02, William Lee wrote:
>Is there a way in velocity to pass in an array list defined in 
>Velocity as a function parameter?
>
>For example, can I have:
>
>#set ($arr = ["blah", "blah", "blah"])
>#set ($result = $tool.foo($arr))
>
>?

Yes.

>If I can do the aboved, what's the signature of the "foo" function 
>of the tool instance $tool?  Is it List, ArrayList, Object[], 
>String[], or something else?

If I recall correctly, $arr will be an instance of ArrayList.  A 
quick way to check is to add its class name to the template and 
reload the template.  I think I used something like:

    $arr.getClass().getName()

--Andy

--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message