velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nbu...@gmail.com>
Subject Re: Re: Putting key/value pair into hashmap from velocity template
Date Thu, 20 Jul 2006 21:39:35 GMT
On 7/20/06, Glenn Holmer <gholmer@weycogroup.com> wrote:
> > I have found at http://www.freebok.net/help/velocity4.html the following
> example:
> > $sisyphus.pushRock()
> > ## Velocity assumes I mean $sisyphus.getRock()
> > Its not discussed in detail what the author meant by his example, but I
> wonder how velocity assumes method calls.
>
> I've always wondered about that one, too...

definitely a typo!  if you use full method syntax (e.g.
$sisyphus.pushRock() ), then Velocity will *only* look for a
pushRock() method with no arguments.  if you do $sisyphus.rock, then
velocity will check for getrock(), getRock(), get("rock"), and
isRock() (and maybe isrock()?)  in roughly that order.  i keep
forgetting... :)

i'm surprised no one has reported this typo in the docs yet! (hint, hint) ;-)

> --
> ____________________________________________________________
> Glenn Holmer                          gholmer@weycogroup.com
> Software Engineer                        phone: 414.908.1809
> Weyco Group, Inc.                          fax: 414.908.1601
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>

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