This is a common error for people new to Velocity. You are required to set a
root that Velocity will initialize the engine with. Every other template you
target, must be in that directory or a subdirectory. You can then define the
files and subdirectories as part of the target file as such:
ex.
Given this directory structure...
D:\
|
|- mytemplate.vm
|- myDirectory
|
|- mySubDirTemplate.vm
Initializing the engine to "d:/", then allows you to merge the following
templates.
"mytemplate.vm"
"myDirectory/mySubDirTemplate.vm"
NOTE: While switching drive letters is currently not supported for target
files, on
UNIX systems, this is probably not much of an issue.
-----Original Message-----
From: Soriano, Jaume [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 10, 2001 8:12 AM
To: [EMAIL PROTECTED]
Subject: Newbee problems
Hi! i'm writing a new application using Velocity as
my template engine but i'm having the following problem.
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?
Thanks in advance, regards:
========<[EMAIL PROTECTED]>=========
Jaume Soriano Sivera
Tel: 965040000 -ext. 44744 Fax: 965040047
Redes y Sistemas / Portal - NNTT
Wanadoo Espa�a - http://www.wanadoo.es
==========================================