velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "carlo latasa" <clat...@gmail.com>
Subject Re: VelocityEngine...
Date Thu, 04 Dec 2008 19:44:44 GMT
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

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