You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Terry Steichen <te...@net-frame.com> on 2004/01/11 18:45:53 UTC

Macro Doesn't Work 1st Time

For as long as I can recall, I've had a problem with Velocity templates that contain macros not working the first time - after the first time they work fine.  Here's a simple example:

---------------------------------------
#show("My Message")

#macro(show $msg)
<h1>$msg</h1>
#end
-------------------------------------

On my system, the first time I invoke this template I get this: ("My Message").  Subsequent times I get "My Message" highligted properly with the H1 tag.

My velocity.properties file includes: velocimacro.permissions.allow.inline.to.replace.global = true

Appreciate any thoughts/advice on whether this is a bug, or if I'm not initializing something properly. 

Regards,

Terry

Re: Macro Doesn't Work 1st Time

Posted by Terry Steichen <te...@net-frame.com>.
Geir,

Thanks.  This bug has been a more or less minor annoyance until I recently
expanded my macro use.  Since then it's become quite a problem and it looked
like I was going to have to jury-rig some kind of application-level
reloader.  If this is going to be fixed, that's great.  Any idea of when
that fix might be made available?

Regards,

Terry

PS: BTW, that bug was in Bugzilla at least a year ago, but it seems to have
disappeared.

----- Original Message -----
From: "Geir Magnusson Jr" <ge...@4quarters.com>
To: "Velocity Users List" <ve...@jakarta.apache.org>
Sent: Sunday, January 11, 2004 1:01 PM
Subject: Re: Macro Doesn't Work 1st Time


>
> On Jan 11, 2004, at 12:45 PM, Terry Steichen wrote:
>
> > For as long as I can recall, I've had a problem with Velocity
> > templates that contain macros not working the first time - after the
> > first time they work fine.  Here's a simple example:
> >
> > ---------------------------------------
> > #show("My Message")
> >
> > #macro(show $msg)
> > <h1>$msg</h1>
> > #end
> > -------------------------------------
> >
> > On my system, the first time I invoke this template I get this: ("My
> > Message").  Subsequent times I get "My Message" highligted properly
> > with the H1 tag.
> >
> > My velocity.properties file includes:
> > velocimacro.permissions.allow.inline.to.replace.global = true
> >
> > Appreciate any thoughts/advice on whether this is a bug, or if I'm not
> > initializing something properly.
> >
>
> You are doing things right.  I've been meaning to fix that for a while
> :)
>
>
> > Regards,
> >
> > Terry
> >
> --
> Geir Magnusson Jr                                   203-247-1713(m)
> geir@4quarters.com
>
>
> ---------------------------------------------------------------------
> 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


Re: Macro Doesn't Work 1st Time

Posted by Geir Magnusson Jr <ge...@4quarters.com>.
On Jan 11, 2004, at 12:45 PM, Terry Steichen wrote:

> For as long as I can recall, I've had a problem with Velocity 
> templates that contain macros not working the first time - after the 
> first time they work fine.  Here's a simple example:
>
> ---------------------------------------
> #show("My Message")
>
> #macro(show $msg)
> <h1>$msg</h1>
> #end
> -------------------------------------
>
> On my system, the first time I invoke this template I get this: ("My 
> Message").  Subsequent times I get "My Message" highligted properly 
> with the H1 tag.
>
> My velocity.properties file includes: 
> velocimacro.permissions.allow.inline.to.replace.global = true
>
> Appreciate any thoughts/advice on whether this is a bug, or if I'm not 
> initializing something properly.
>

You are doing things right.  I've been meaning to fix that for a while 
:)


> Regards,
>
> Terry
>
-- 
Geir Magnusson Jr                                   203-247-1713(m)
geir@4quarters.com


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