velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randal Walser <>
Subject how to pass a Map to a method
Date Fri, 14 Jan 2005 13:18:42 GMT
Is it possible to use VTL map notation to pass a map to a method?  I
can set a variable to a map and then pass the variable to a method,
but I get a ParseErrorException when the argument is expressed in
notational form:

    #set( $map = {"a" : "b", "c" : "d"} )   ## This works,
    $foo.takeMap( $map )                    ## and so does this,
    $foo.takeMap( {"a" : "b", "c" : "d"} )  ## but this fails.

Since an ArrayList can be passed like this

    $foo.takeArrayList( ["a", "b", "c", "d"] )

shouldn't it be possible to pass a Map in similar fashion?



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

View raw message