velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nat...@esha.com>
Subject Re: non-caching macro library & method pointers
Date Tue, 03 Jun 2003 17:02:06 GMT
Martin Roller said:
...
> I'm new to velocity and have a few questions.
> The mailarchive
>    http://www.mail-archive.com/velocity-user@jakarta.apache.org/
> appears to be down, so sorry if I ask obvious questions.

there are other archives of this list too:
http://marc.theaimsgroup.com/?l=velocity-user&r=1&w=2
http://nagoya.apache.org/eyebrowse/SummarizeList?listId=103

> 1. I would like to use the realoading feature of the global macro library.
>    However, I can only see changes to VM_global_library.vm after the
>    Server is restarted.

if you can't get it working, you could always just leave the 'allow inline to
override global' property as true and do #parse( "VM_global_library.vm" ) in one
of your templates to test.  i do this sometimes in dev.  i would not do it in
production.

> 2. Can I load the global library via another loader? I would like to
>    specify the path relative, e.g. relative to the classpath, so I can
>    pack velocity.properties in a war file.

you can specify multiple resource loaders for Velocity to search when trying to
load a template.  the developer's guide addresses this.

> 3. Is it possible to specify methods at runtime? I would like to to
>    something like the following.
>
>    #set ($method = "myMethod")
>    $object.$method.$argument

heh.  as Jon used to always say, "this isn't perl."  but you can pull this off
using a tool.  there are two tools available for this in the velocity-tools
project--the RenderTool and the ViewRenderTool.

Nathan Bubna
nathan@esha.com


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