|
From: <jue...@we...> - 2003-11-13 16:32:49
|
Velocity.init and Velocity.getTemplate use their own singleton = underneath - but you don't need to use that part of the Velocity API, as = VelocityEngine is an alternative to it, AFAIK. The benefit of = VelocityEngine is that you can have multiple Velocity configurations = within the same application, i.e. within the same class loader. If you use a VelocityEngineFactoryBean to set up a VelocityEngine = singleton, that VelocityEngine instance will be a real singleton in the = Spring application context. You need to invoke getTemplate on the = VelocityEngine instance then instead of the static getTemplate method on = the Velocity class. We're using this ourselves for email templates; it = does work properly. Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Ivan Ristic Sent: Thursday, November 13, 2003 5:24 PM To: spr...@li... Subject: [[W3-SPAM]] - Re: [Springframework-developer] VelocityEngineFactory question - Email found in subject > Use VelocityEngineFactoryBean - it is a subclass of > VelocityEngineFactory that provides exactly what you need: > a singleton VelocityEngine in an application context. It is singleton in terms of Spring bean configuration process but not a real singleton. A single call to Velocity.init(properties) is needed to initialize the engine as a singleton. Later in the code you simply use Velocity.getTemplate(templateName) to get the template. --=20 ModSecurity (http://www.modsecurity.org) [ Open source IDS for Web applications ] ------------------------------------------------------- This SF.Net email sponsored by: ApacheCon 2003, 16-19 November in Las Vegas. Learn firsthand the latest developments in Apache, PHP, Perl, XML, Java, MySQL, WebDAV, and more! http://www.apachecon.com/ _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |