velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Glass-Husain" <>
Subject Re: File Resource Loader
Date Sun, 06 May 2007 13:53:57 GMT
That looks ok to me.

Could it be a capitalization or file permission issue?


On 5/5/07, Adam Cornett <> wrote:
> I am implementing Velocity in a website and everything is going
> fine...except I can't get it to load templates from inside java code.  For
> example, one class e-mails a registration confirmation to a user, I have a
> template that sends them a pretty html e-mail, however when I try to load
> the template, I get a
> org.apache.velocity.exception.ResourceNotFoundException.  I have tried
> several different fixes, from putting a copy of the template in every
> reasonable directory, setting the file resource loader path... nothing
> works.  Here is some of my code:
> /* The function is called from a static method in a class via another
> template located at /familyweekend/regapp/test_email.vm, with the template
> file in the same directory. */
> ExtendedProperties ep = new ExtendedProperties();
> ep.setProperty("file.resource.loader.path", "/familyweekend/regapp,
> /v_templates, .");
> ep.setProperty("file.resource.loader.cache ", true);
> ep.setProperty("file.resource.loader.modificationCheckInterval", 2);
> ep.setProperty("resource.loader", "file");
> VelocityEngine ve = new VelocityEngine();
> ve.setExtendedProperties(ep);
> Template tem== ve.getTemplate(EMail_Template);    /* EMail_Template is a
> String defined else where, and yes, its the right name */
> And it throws the error everytime at the last line.  I have no idea what
> I'm
> doing wrong, and I've read the online documentation several times and it
> doesn't seem to help.
> -Adam Cornett

Forio Business Simulations

Will Glass-Husain

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