velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Closs <ja...@bitbull.com>
Subject newbie - can't get VelocityServlet to read configuration file
Date Mon, 15 Aug 2005 15:47:17 GMT
Hi,

I've just started working with Velocity under Mac OSX using the book  
'Pro Jakarta Velocity' and am having one problem...

I've set up a simple 'Hello, World' type servlet as a subclass of  
VelocityServlet. It works, but I can't get it to read any sort of  
configuration parameters.

I have in my web.xml file the following:

<servlet>
   <servlet-name>HelloWorldVelocity</servlet-name>
   <servlet-class>
     com.maturus.battletextwww.HelloWorldVelocity
   </servlet-class>

   <init-param>
     <param-name>properties</param-name>
     <param-value>/velocity.properties</param-value>
</init-param>
</servlet>

...and my velocity.properties file (which is in the correct place) is:

resource.loader=file,class

# FILE RESOURCE LOADER
file.resource.loader.class =  
org.apache.velocity.runtime.resource.loader.FileResourceLoader
file.resource.loader.path = /Developer/jakarta-tomcat-4.1.31/webapps/ 
battletxt/WEB-INF/classes
file.resource.loader.cache = false
file.resource.loader.modificationCheckInterval = 2

# CLASSPATH RESOURCE LOADER
class.resource.loader.class=org.apache.velocity.runtime.resource.loader. 
ClasspathResourceLoader
class.resource.loader.cache=false
class.resource.loader.modificationCheckInterval=1

...however none of these settings appear to impact the velocity  
runtime whatsoever. I presume the <init-param> is being read OK as  
when I change the reference to a file that doesn't exist I get an  
error as one would expect.

Any help much appreciated...


====

James Closs, Director, bitBull Ltd

http://www.bitbull.com

07771 991171

====


---------------------------------------------------------------------
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