You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Ilkka Priha <ip...@surfeu.fi> on 2001/03/20 23:39:25 UTC

velocity.properties vs properties of Velocity Service

It seems that the separate velocity property file doesn't get loaded any
more. In the velocity service, the three service properties are read, but
only the log property and the templates property are passed to velocity.

>> String vProperties = TurbineServlet.getRealPath(
>>     props.getProperty("properties", null));
>> String vLog = TurbineServlet.getRealPath(
>>     props.getProperty("log", null));
>> String vTemplates = TurbineServlet.getRealPath(
>>     props.getProperty("templates", null));
>>
>> try
>> {
>>     Velocity.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH,vTemplates);
>>     Velocity.setProperty(Velocity.RUNTIME_LOG, vLog);
>>     Velocity.init();
>>
>>     Velocity.setProperty(Velocity.TEMPLATE_ENCODING, encoding);

It's possible to give a property file path to the Velocity.init() method,
but unfortunately it overrides the two previous settings. On the other hand,
if init(vProperties) is called before the settings, then the settings are
ignored by velocity (as is the encoding setting above). Sorry, if I've
missed something during the service update and this is totally irrelevant.

-- Ilkka

[mailto:ext-ilkka.priha@nokia.com]


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org