velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geir Magnusson Jr. <ge...@adeptra.com>
Subject Re: calling arbitrary methods from within template
Date Fri, 13 Dec 2002 19:54:36 GMT

On Friday, December 13, 2002, at 10:04 AM, Jan Geiger wrote:

> Hi,
>
> I'd like to call arbitrary-named methods from a velocity template, e.g.
> printMessage("...") or pushRock(myRock) (just referring to the user's 
> guide ...).
> Unfortunately Velocity always seems to assume that I'm using
> property-accessor methods (i.e. getters and setters). Is there a 
> possibility to call such
> arbitrary-named methods and further use their return values (which 
> would be
> calculated whilst method-execution) or do I have to use "Prepared 
> Objects" which
> I put into the Velocity-context and which contain the data I want to 
> access
> in a JavaBeans-like manner (i.e. I have to setup them in my java 
> programs)?

You can call any method that is publicly accessible.

-- 
Geir Magnusson Jr                                   203-355-2219(w)
Adeptra, Inc.                                       203-247-1713(m)
geirm@adeptra.com


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