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 2002/03/11 17:58:29 UTC

Velocitymacro caching independent of template

I have template caching off, so when I modify the template the change shows up with the next browser refresh.  However, if I change the code inside a velocimacro in that same template, the change doesn't take effect unless and until I restart Tomcat.

Is this the way it is supposed to work?

Regards,

Terry
 

Re: Velocitymacro caching independent of template

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 3/11/02 1:00 PM, "Terry Steichen" <te...@net-frame.com> wrote:

> Geir,
> 
> Yes, that does work.  Thanks.
> 
> <$.02>Given that the macro I was using was in scope to its own template, it
> was (and is) a bit counterintuitive to see what that has to do with global
> macros.  To have this as default behavior could lead (as it did for me) to a
> lot of frustration (before I finally figured it out).  I kept trying because
> I knew how well Velocity worked - newcomers might get a surprise on
> this.</$.02>

Yes, agreed to some degree, but the reason is historical.

1) We didn't have the concept of 'namespace', associating macros with the
template that registered it.

2) We wanted to protect the library macro definitions from 'malicious'
replacement by user templates.



-- 
Geir Magnusson Jr.                                     geirm@optonline.net
System and Software Consulting
"Now what do we do?"


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Velocitymacro caching independent of template

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

Yes, that does work.  Thanks.

<$.02>Given that the macro I was using was in scope to its own template, it
was (and is) a bit counterintuitive to see what that has to do with global
macros.  To have this as default behavior could lead (as it did for me) to a
lot of frustration (before I finally figured it out).  I kept trying because
I knew how well Velocity worked - newcomers might get a surprise on
this.</$.02>

Regards,

Terry
----- Original Message -----
From: "Geir Magnusson Jr." <ge...@optonline.net>
To: <ve...@jakarta.apache.org>
Sent: Monday, March 11, 2002 12:08 PM
Subject: Re: Velocitymacro caching independent of template


> On 3/11/02 11:58 AM, "Terry Steichen" <te...@net-frame.com> wrote:
>
> > I have template caching off, so when I modify the template the change
shows up
> > with the next browser refresh.  However, if I change the code inside a
> > velocimacro in that same template, the change doesn't take effect unless
and
> > until I restart Tomcat.
> >
> > Is this the way it is supposed to work?
> >
>
> Depends on the settings.  It should be the case that
>
> velocimacro.permissions.allow.inline.to.replace.global = true
>
> Fixes that.  The default value is 'false' to prevent things from getting
> stepped on...  So that is what might be happening.
>
>
> --
> Geir Magnusson Jr.                                     geirm@optonline.net
> System and Software Consulting
> POC lives!
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Velocitymacro caching independent of template

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 3/11/02 11:58 AM, "Terry Steichen" <te...@net-frame.com> wrote:

> I have template caching off, so when I modify the template the change shows up
> with the next browser refresh.  However, if I change the code inside a
> velocimacro in that same template, the change doesn't take effect unless and
> until I restart Tomcat.
> 
> Is this the way it is supposed to work?
> 

Depends on the settings.  It should be the case that

velocimacro.permissions.allow.inline.to.replace.global = true

Fixes that.  The default value is 'false' to prevent things from getting
stepped on...  So that is what might be happening.


-- 
Geir Magnusson Jr.                                     geirm@optonline.net
System and Software Consulting
POC lives!


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>