velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mxc <m...@jumpingbean.co.za>
Subject Velocity in standalone application -- tutorial?
Date Sun, 31 Dec 2006 07:40:08 GMT

Hi there,


I am using velocity in a standalone application, i.e. not as part of a web
app. I am trying to use the classpath template loader but can't get it to
work. It seems that there are hardly any tutorials on how to do this for
non-web apps. I have tried  the following:


		Properties property = new Properties();
		URL url = this.getClass().getResource("velocity.properties");
		property.load(url.openStream());
		Velocity.init(property); 


In the velocity.properties I have the following:


resource.loader = class class.resource.loader.class =
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader


I then place the template in my classpath but the template is not found.


			template = velocity.getTemplate("daoInterface.vm");



Any help appreciated.
-- 
View this message in context: http://www.nabble.com/Velocity-in-standalone-application----tutorial--tf2901029.html#a8105054
Sent from the Velocity - User mailing list archive at Nabble.com.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message