You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Andrew Fooks <a....@qut.edu.au> on 2005/11/16 00:32:20 UTC

Veltags and Velocimacros

I am working on a Struts web app that uses JSP as the view (this much is 
unavoidable), which I'm not fond of, so I'm using Veltags as much as 
possible.

My question is, can I use velocimacros in veltags?  I've tried, and it 
doesn't work, because it can't appear to find the global macro library.  
I think the main problem is that I'm unsure which directory the engine 
would be looking in for the global macro library.

any advice is welcome.

A



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


Re: Veltags and Velocimacros

Posted by Nathan Bubna <nb...@gmail.com>.
On 11/15/05, Andrew Fooks <a....@qut.edu.au> wrote:
> I am working on a Struts web app that uses JSP as the view (this much is
> unavoidable), which I'm not fond of, so I'm using Veltags as much as
> possible.
>
> My question is, can I use velocimacros in veltags?

i'm rather sure it is.

>  I've tried, and it
> doesn't work, because it can't appear to find the global macro library.
> I think the main problem is that I'm unsure which directory the engine
> would be looking in for the global macro library.

that is the trick.  by default, Velocity will use the
FileResourceLoader and that should have its root set as the "current"
running directory for the app.  i have no idea what that will be on
your system.  so, all i can give is encouragement to keep trying
various directories.  and be sure that your velocimacro library file
is name "VM_global_library.vm".

your other alternative is to tweak and rebuild the Veltag to use a
velocity.properties file that you specify, rather than the default. 
then you can tell the FileResourceLoader where to look for your macro
library and any templates you wish to #include or #parse.

> any advice is welcome.
>
> A
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>

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