velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Bubna <nbu...@gmail.com>
Subject Re: Processing Templates with #parse
Date Mon, 18 Jul 2005 20:35:27 GMT
On 7/6/05, archana.babu@wipro.com <archana.babu@wipro.com> wrote:
> 
> Hi,
> I'm new to velocity. I'm trying to get the integration of velocity and
> struts going.
> 
> VelocityViewServlet is being used to handle all the calls to *.vm files.
...
> The properties set in velocity.properties are:
> 
> file.resource.loader.path = templates
> runtime.log = velocity.log
> 
> While processing homepagetemplate, ResourceNotFoundException is thrown
> because it has
> 
> #parse("availability/propertytemplate.vm")
> 
> It tries to find the template directly under the web app working
> directory and not from the root specified from the properties file
> ("templates").
> I guess processing the "homepagetemplate.vm" was fine because
> strutsconfig has the complete path.
> 
> Could some one point me out the point at which i'm doing it incorrectly?
...

the VelocityViewServlet uses the WebappLoader (also in the
VelocityTools project) as its resource loader by default.  it
programmatically configures Velocity to do this and registers the
loader as "webapp" rather than "file".  this means that the
velocity.properties value(s) you should be specifying/adjusting in
order to add a directory from which templates may be loaded is:

webapp.resource.loader.path = foo

the above one would cause the WebappLoader to also check the "foo"
directory under the webapp root.

hope that helps.

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


Mime
View raw message