velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <>
Subject Re: Velocity w Tomcat Prob
Date Thu, 15 Feb 2001 18:25:36 GMT wrote:
>  I am evaluating Velocity with servlets (using the Tomcat 3.2 servlet
>  engine).
>  I get the follwoing erro running the SampleServlet:
>  Error processing the template
>  Cannot find the template!
>  The sample.vm file is in the same location as the SampleServlet.class file
>  (under WEB_INF/classes).  Is this the wrong place?  Is there somewhere I
>  have to config the template path?  Is there a Velocity/Tomcat setup
>  wlakthrough anywhere?

Take a look at the documentation on the site

The upshot is that velocity must be configured to find the template.  
There is a property 
resource.loader.1.resource.path = <directory>

through which you can set where vel looks for the template.  The default
is the 'current directory', which for the servlet engine, is whatever
directory you were in when you started tomcat.

You can :

1) put the template in the current directory from where you start
tomcat.  This is the fastest way to see something, but a horrible
configuration approach :)

2) Make a file,, place it into the root directory of
your webapp, and put the property in there.  Then, follow the directions

on how to work with servlets. The docs aren't spectacular, but should
give you a good idea. 

The velocity.log is also a great source for information - it will tell
you where the resource loader is looking to load templates.

good luck.  come back if you still have problems.  All of the vel
developers use Tomcat, so it certainly works well with Velocity. ;)


Geir Magnusson Jr.                     
Velocity : it's not just a good idea. It should be the law.

View raw message