velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shinobu Kawai <shin...@ieee.org>
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
state.

Best regards,
-- Shinobu Kawai

--
Shinobu Kawai <shinobu@ieee.org, shinobu@computer.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