apache.org.velocity...... Help needed!!!
Hi,
I am using the velocity framework of the apache.... I am getting a template as follows..
Template temp=Velocity.getTemplate("mailTemplate.vm");
where mailTemplate.vm is a file which as some data like $greeting $ name $ content $signature...
here i am getting an exception that resourceNorFound though i have mailTemplate.vm file.....
can anyone suggest me for this?
# 2
public ContructorName() throws Exception
{
configure(engine);
}
private void configure(VelocityEngine engine) throws Exception
{
Properties props = new Properties();
props.setProperty(VelocityEngine.RESOURCE_LOADER, "classpath");
props.setProperty("classpath." + VelocityEngine.RESOURCE_LOADER + ".class",ClasspathResourceLoader.class.getName());
engine.init(props);
}
configuring your engine might help and then call engine.getTemaplte(filename);