velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shinobu Kawai <>
Subject Re: Is there anyway I can access a static method from a Velocity Template?
Date Wed, 04 Aug 2004 22:45:55 GMT

Hi Krishnan,

> I have my Renderer as a standalone Java Class. This Java class kicks of 
> rendering of Composites. Composites in turn kick off rendering Components. 
> Now in my layout template I would like call back the Renderer. Even though 
> all the methods in the Renderer are static, I still have to create an 
> instance of the Renderer and put it in the context for the VTL to get access 
> to this object.
> Is there a way around it? I made renderer stateless to precisely avoid 
> creating multiple instances.
How about making it a Singleton?

Actually, I have never came across a situation where creating multiple
instances became an issue.  You can think of it as a MonoState, with no

Best regards,
-- Shinobu Kawai

Shinobu Kawai <,>

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

View raw message