Hi,

I can load templates from the classpath but not from a file. Please tell me what I'm doing wrong.

I'm using this as the template string when calling mergeTemplate()

"c:\\output\\testSheets.vm"

and I get this error:

org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'c:\output\testSheets.vm'

here are the properties I'm using to initialize Velocity.

Properties props = new Properties();
props.put("resource.loader", "file, class");
props.put("file.resource.loader.description", "Velocity File Resource Loader");
props.put("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader");
props.put("file.resource.loader.path", ".");
props.put("file.resource.loader.cache", "true");
props.put("file.resource.loader.modificationCheckInterval", "0");
props.put("class.resource.loader.description", "Velocity Classpath Resource Loader");
props.put("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
props.put("class.resource.loader.cache", "true");
props.put("class.resource.loader.modificationCheckInterval", "0");
Velocity.init(props);




--
Best regards,
 Michael




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to