velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nbu...@gmail.com>
Subject Re: VelocityEngine...
Date Thu, 04 Dec 2008 20:19:55 GMT
You've read the Developer Guide, right? :)

http://velocity.apache.org/engine/releases/velocity-1.6/developer-guide.html

On Thu, Dec 4, 2008 at 11:44 AM, carlo latasa <clatasa@gmail.com> wrote:
> Thanks both of you for the quick response.
>
> So I'm not creating a static instance of the VelocityEngine in my Directive
> base class and calling init in a static initalizer.
>
> Now when getTemplate is called on the velocityEngine instance I get:
>
> org.apache.velocity.exception.ResourceNotFoundException: Unable to find
> resource '/templates/dashheader.vm'
>    at
> org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:452)
>    at
> org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:335)
>    at
> org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1102)...
>
> There's a setting in either velocity.properties or struts.properties that
> tells the engine where to look. What is that setting?
>
> I'm assuming that calling init() on the engine with no params will default
> to using the velocity.properties file in my WEB-INF/classes dir.
>
> Thanks again.
>
> On Thu, Dec 4, 2008 at 9:19 AM, carlo latasa <clatasa@gmail.com> wrote:
>
>> So in the webwork 1.x code I have, there's a subclass of the velocity
>> runtime Directive class that has some code like the following:
>>
>>     protected VelocityEngine velocityEngine =
>> VelocityManager.getInstance().getVelocityEngine();
>>     Template template = velocityEngine.getTemplate(templateName);
>>
>>
>>
>
>
> --
> Carlo Latasa
> EdgeDriven.com
> Cell: (415) 385-1567
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message