Hello,
I've spent good 10 hours trying to load template in webapp.
First I tried
resource.loader= file
and putting template into any posible directory, WEB-INF, classes,
lib, web app root.
Also tried to use
resource.loader=class
Putting template in all possible places. Including create template.jar
and putting it in /lib.
It's always "Unable to find resource 'template.vm'"

So I nothing helps using out-of-the-box methods.
I wrote class ResourceLoader extends
org.apache.velocity.runtime.resource.loader.ResourceLoader

and put resource.loader=custom

I added Log message into getResourceStream(), the method to be called
when template is requested.
Java code:
VelocityEngine ve = new VelocityEngine();
ve.init();
Template template = Velocity.getTemplate("template.vm");

What do I get in log:
INFO   - getResourceStream() load VM_global_library.vm
ERROR  - Unable to find resource 'template.vm'

It looks for VM_global_library.vm! Why???
In velocity.properties it's even commented out:
# velocimacro.library = VM_global_library.vm
And VM_global_library.vm is present in path just in case.
I don't get any messages that VM_global_library.vm not found, I gt
message that requested template not found but request to
ResourceLoader wasn't made for that template.

How do find template resources in webapp?
Why even that I implemented my own resourceLoader, it looks for
VM_global_library.vm and returns that requested template not found?

Thanks.

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

Reply via email to