velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Oliver" <>
Subject RE: template path
Date Wed, 03 Aug 2005 21:48:43 GMT
I am setting 

Where 've' is a valid velocity engine and this line occurs before the

and I can confirm my template is located in that directory,


yet it throws a ResourceNotFoundException when I try a 

Velocity.ENCODING_DEFAULT,context, sw);
I checked in the debugger and the overriding properties shows the path set

The debugger also shows the resourceManager has this as one of the paths,
but the template paths are all null.

Michael Oliver
Alarius Systems LLC
6800 E. Lake Mead Blvd, #1096
Las Vegas, NV 89156
*Note new email changed from

-----Original Message-----
From: Michael Oliver [] 
Sent: Wednesday, August 03, 2005 9:15 AM
Subject: template path

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
6800 E. Lake Mead Blvd
Apt 1096
Las Vegas, NV 89156
tel: (702)643-7425
fax: (702)974-0341
mobile: (518)378-6154

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

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

View raw message