velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <>
Subject Re: Newbee problems
Date Mon, 10 Sep 2001 22:50:23 GMT
On 9/10/01 2:12 AM, "Soriano, Jaume" <> wrote:

> Hi! i'm writing a new application using Velocity as
> my template engine but i'm having the following problem.

Great.  Welcome to our happy family.

> When i try to execute my application i get:
> org.apache.velocity.exception.ResourceNotFoundException: Unable to find
> resource 'paises.vm'
> My 'vm' file is located at root level in the context
> (.../tomcat/webapps/myapplication/paises.vm)
> and i'm trying to merge it from my java code using a line
> like this:
> Velocity.mergeTemplate("paises.vm",ctx,somethingHTML);
> Where is Velocity trying to find the vm file?
> Is this an absolute path? is it configurable?

IT's very configurable.  Velocity will by default look in the 'current
directory' if nothing else is set.

For servlet work, there are many ways of doing this.  I suggest that you
look at the servlet examples in examples/ particularly servlet_example2,
which shows two ways of doing it, by file or from jar, and also shows how
you can rig your servlet to configure the resource paths automatically from
the webapp root.


Geir Magnusson Jr.
System and Software Consulting
Developing for the web?  See
If you look up, there are no limits - Japanese Proverb

View raw message