You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Lu, Tao" <Ta...@Ajilon.com> on 2003/10/28 00:51:11 UTC

problem with "velocimacro.library"

Hi, experts,
 
I have a template library called "a.vm" under "C:\", and here is my velocity.properties:
runtime.log = velocity.log
velocimacro.library=C:/a.vm
 
It seems that I can not pick up any any velocimacro defined in a.vm.
 
Any suggestion will be greatly appriecated. 
 
Thanks
Tao
 
 

RE: problem with "velocimacro.library"

Posted by Shawn Church <sh...@boxity.com>.
You might also want to set your file.resource.loader.path, since the velocimacro.library path is relative to that location.  Also, if you are developing your application as a servlet, note that the file.resource.loader.path is relative to your servlet webapp base.

Here's an example velocity.properties you might use within a servlet container:

file.resource.loader.path = /WEB-INF/templates
velocimacro.library = a.vm

The a.vm would reside in $webapp_base/WEB-INF/templates.

And I believe this would work for a standalone application:

file.resource.loader.path = c:/
velocimacro.library = a.vm

Other parameters which might also be helpful to you are these (if you are developing within a servlet environment):

velocimacro.permissions.allow.inline
velocimacro.permissions.allow.inline.to.replace.global
velocimacro.library.autoreload

I think most of these are described here:
http://jakarta.apache.org/velocity/developer-guide.html


Shawn

-----Original Message-----
From: Lu, Tao [mailto:Tao.Lu@Ajilon.com]
Sent: Monday, October 27, 2003 5:51 PM
To: velocity-user@jakarta.apache.org
Subject: problem with "velocimacro.library"


Hi, experts,
 
I have a template library called "a.vm" under "C:\", and here is my velocity.properties:
runtime.log = velocity.log
velocimacro.library=C:/a.vm
 
It seems that I can not pick up any any velocimacro defined in a.vm.
 
Any suggestion will be greatly appriecated. 
 
Thanks
Tao
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: problem with "velocimacro.library"

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On Monday, October 27, 2003, at 06:51 PM, Lu, Tao wrote:

> Hi, experts,
>
> I have a template library called "a.vm" under "C:\", and here is my 
> velocity.properties:
> runtime.log = velocity.log
> velocimacro.library=C:/a.vm
>
> It seems that I can not pick up any any velocimacro defined in a.vm.
>
> Any suggestion will be greatly appriecated.

If I recall correctly, if that is the only configuration you are doing, 
then the root of the 'template path' will be the current directory that 
you are starting from.  Thus, you can't escape out of it and get a 
template from somewhere else, like the root of the filesystem, which is 
what I think your problem is if you aren't running from c:\

do this : copy the a.vm in to the directory you are running from, and 
change the properties to


velocimacro.library = a.vm

and see what happens

-- 
Geir Magnusson Jr                                   203-247-1713(m)
geirm@optonline.net


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org