velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shinobu Kawai Yoshida <shinobu.ka...@gmail.com>
Subject Re: how to pass a Map to a method
Date Fri, 14 Jan 2005 13:46:29 GMT
Hi Randal,

> 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?

I'd say it should.  Maps are features of the upcoming 1.5, which is
still under development.  Maybe it's a bug, maybe it's simply not
implemented yet.  You could file a bugzilla issue so the developers
get reminded.  Better yet, you can submit a patch to give the
suggested behaviour!  ;)

Best regards,
-- Shinobu

--
Shinobu "Kawai" Yoshida <shinobu.kawai@gmail.com>

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


Mime
View raw message