velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <>
Subject Re: calling arbitrary methods from within template
Date Fri, 13 Dec 2002 18:32:14 GMT
Christopher said:
> Hello,
> you *can* call arbitrary methods on objects that are in the context.
> To take up your examples, they should state:
> $foo.printMessage("...")
> $bar.pushRock(myRock)

actually, this last example is not valid VTL.
it should probably be something like

$bar.pushRock( $myRock )

where $myRock is another valid context object of the type expected by the
pushRock() method

fine point of difference (probably a just a typo), but important.  you can't
have schmoo in a method's parentheses.  only context variables or valid
integer, boolean, or string literals.

Nathan Bubna

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

View raw message