velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Akshay Kapur <>
Subject Fwd: Macros defined Inline and #parse
Date Tue, 01 Apr 2003 23:44:08 GMT
Correction: By compile time in my previous mail(as forwarded below), I had 
meant to say "parse-time". Apologize for the confusion caused if any.

Also, I just subscribed to this list after I sent the mail, I may have 
potentially missed your response. In that case, I will appreciate if you 
could resend it.


>Date: Tue, 01 Apr 2003 15:15:16 -0800
>From: Akshay Kapur <>
>Subject: Macros defined Inline and #parse
>There is a scenario wherein a parent.vm #parses a child.vm(which contains 
>a macro definition and it's invocation). The config property 
>velocimacro.permissions.allow.inline.local.scope is set to false. The 
>child.vm is parsed properly and the macro correctly executes too.
>However, when I set this property to true, the macro doesn't get invoked.
>Now I have read the Velocity users guide which explains that macros are 
>loaded into memory at compile time and since #parse command is executed at 
>run-time, the macros defined inline in a #parsed file don't get loaded at all.
>My question is why does switching the above mentioned config property to 
>false make the whole thing work??!! Why do the inline macros get loaded in 
>the first place when the rules for compile-time/ run-time should be the 
>same irrespective of the switch?
>--Structure of the above mentioned files is depicted below --
>#parse( "child.vm" )
><< EOF >>
>#macro ( print )
>..I was defined in included file!!!
><< EOF >>

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message