Hi,

I'm trying to get a webapp to read template files from a template directory 
located under the web application root /template/

I tried to use the Velocity Singleton with the FileResourceLoader, specifying 
different paths in velocity.properties such as

file.resource.loader.path = ../webapps/app_name/template/

But no matter what I set the path to, velocity still seems to use the default 
FileResourceLoader path of '.'
I've confirmed this by placing a template in $CATALINA_HOME/bin
where velocity is able to find the template correctly. It seems as though the 
velocity.properties file isn't being read.

Here is my web.xml file. You can see I've got the <init-param>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee";
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
          xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
          version="2.4">

          <servlet>
                   <servlet-name>automatchingServlet</servlet-name>

                   
<servlet-class>org.apache.velocity.tools.view.servlet.VelocityViewServlet</servlet-class>

                   <init-param>
                             
<param-name>org.apache.velocity.toolbox</param-name>
                             <param-value>/WEB-INF/toolbox.xml</param-value>
                   </init-param>

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

          <servlet-mapping>
                   <servlet-name>automatchingServlet</servlet-name>
                   <url-pattern>*.vm</url-pattern>
          </servlet-mapping>
</web-app>

How do I configure the FileResourceLoader to find my template files? I've read 
several posts and although the WebappResourceLoader would be a good solution, 
but I'm not able to use a beta version of velocity tools.

Thanks
Roger






***********************************************************************************
The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered 
Office: 36 St Andrew Square, Edinburgh EH2 2YB. 
Authorised and regulated by the Financial Services Authority 
 
This e-mail message is confidential and for use by the 
addressee only. If the message is received by anyone other 
than the addressee, please return the message to the sender 
by replying to it and then delete the message from your 
computer. Internet e-mails are not necessarily secure. The 
Royal Bank of Scotland plc does not accept responsibility for 
changes made to this message after it was sent. 

Whilst all reasonable care has been taken to avoid the 
transmission of viruses, it is the responsibility of the recipient to 
ensure that the onward transmission, opening or use of this 
message and any attachments will not adversely affect its 
systems or data. No responsibility is accepted by The 
Royal Bank of Scotland plc in this regard and the recipient should carry 
out such virus and other checks as it considers appropriate. 
Visit our websites at: 
www.rbs.com
www.rbs.com/gbm
www.rbsgc.com
***********************************************************************************

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

Reply via email to