velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Oliver" <ol...@alariussystems.com>
Subject template path
Date Wed, 03 Aug 2005 16:15:24 GMT
I would like to set a property in the Velocity Engine so I can load a
template from the classpath.

I have a number of different templates that are related to various packages
and classes and it would be easier if I built my jar file with the templates
in the same path as the classes.

I would then name the templates the same and change the template path to
match the package path of the class it relates to.

Is the following the right way?

/*
 * create a new instance of the engine
 */
VelocityEngine ve = new VelocityEngine();
/*
  * configure the engine. In this case, we are using * ourselves as a
  * logger (see logging examples..)
 */
ve.setProperty(VelocityEngine.RUNTIME_LOG_LOGSYSTEM, this);
ve.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH, myPackagePath);
		

------------------------------------
Alarius Systems LLC
Mike Oliver
CTO
ollie@alariussystems.com
mikeoliveraz@yahoo.com
6800 E. Lake Mead Blvd
Apt 1096
Las Vegas, NV 89156
tel: (702)643-7425
fax: (702)974-0341
mobile: (518)378-6154
IM: MikeOliverAZ@yahoo.com
http://www.alariussystems.com/
------------------------------------



---------------------------------------------------------------------
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