velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geir Magnusson Jr. <>
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)

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

View raw message