velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kelvin Tan" <kel...@relevanz.com>
Subject Re: velocimacro.permissions.allow.inline.local.scope (again)
Date Fri, 08 Mar 2002 04:26:39 GMT
A closer look revealed what was really going on behind the scenes.

I initialized Velocity in a Initialization servlet which is called on
startup. Note that I use the Singleton model (Velocity.init(properties)).
Velocity.log displays the correct log info.

When I start my webapp however, a screen which subclasses VelocityServlet is
called. This actually causes velocity.log to reload, displaying default log
properties. I noticed this because I realized that log times were different
before and after VelocityServlet was called.

Check out my log for velocity-20020307.jar (note the times, and that
"Velocity successfully started" is displayed twice):

Fri Mar 08 12:15:17 GMT+08:00 2002   [info] Velocimacro :  VM library
template macro registration complete.
Fri Mar 08 12:15:17 GMT+08:00 2002   [info] Velocimacro : allowInline = true
: VMs can be defined inline in templates
Fri Mar 08 12:15:17 GMT+08:00 2002   [info] Velocimacro :
allowInlineToOverride = true : VMs defined inline may replace previous VM
definitions
Fri Mar 08 12:15:17 GMT+08:00 2002   [info] Velocimacro : allowInlineLocal =
false : VMs defined inline will be  global in scope if allowed.
Fri Mar 08 12:15:17 GMT+08:00 2002   [info] Velocimacro : messages on  : VM
system will output logging messages
Fri Mar 08 12:15:17 GMT+08:00 2002   [info] Velocimacro : autoload on  : VM
system will automatically reload global library macros
Fri Mar 08 12:15:17 GMT+08:00 2002   [info] Velocimacro : initialization
complete.
Fri Mar 08 12:15:17 GMT+08:00 2002   [info] Velocity successfully started.
oOverride = false : VMs defined inline may NOT replace previous VM
definitions
Fri Mar 08 12:15:04 GMT+08:00 2002   [info] Velocimacro : allowInlineLocal =
true : VMs defined inline will be local to their defining template only.
Fri Mar 08 12:15:04 GMT+08:00 2002   [info] Velocimacro : messages on  : VM
system will output logging messages
Fri Mar 08 12:15:04 GMT+08:00 2002   [info] Velocimacro : autoload on  : VM
system will automatically reload global library macros
Fri Mar 08 12:15:04 GMT+08:00 2002   [info] Velocimacro : initialization
complete.
Fri Mar 08 12:15:04 GMT+08:00 2002   [info] Velocity successfully started.
Fri Mar 08 12:15:21 GMT+08:00 2002   [info] Velocimacro : added new VM :
#pager( ) : source = asset-select.vm
Fri Mar 08 12:15:21 GMT+08:00 2002   [info] Velocimacro : added new VM :
#javascript( ) : source = asset-select.vm
Fri Mar 08 12:15:21 GMT+08:00 2002   [info] Velocimacro : added new VM :
#pagebody( ) : source = asset-select.vm

Log for velocity-dep-1.2.jar (slightly different):

Before calling VelocityServlet:
Fri Mar 08 12:24:28 GMT+08:00 2002   [info] Velocimacro :  VM library
template macro registration complete.
Fri Mar 08 12:24:28 GMT+08:00 2002   [info] Velocimacro : allowInline = true
: VMs can be defined inline in templates
Fri Mar 08 12:24:28 GMT+08:00 2002   [info] Velocimacro :
allowInlineToOverride = false : VMs defined inline may NOT replace previous
VM definitions
Fri Mar 08 12:24:28 GMT+08:00 2002   [info] Velocimacro : allowInlineLocal =
true : VMs defined inline will be local to their defining template only.
Fri Mar 08 12:24:28 GMT+08:00 2002   [info] Velocimacro : messages on  : VM
system will output logging messages
Fri Mar 08 12:24:28 GMT+08:00 2002   [info] Velocimacro : autoload on  : VM
system will automatically reload global library macros
Fri Mar 08 12:24:28 GMT+08:00 2002   [info] Velocimacro : initialization
complete.
Fri Mar 08 12:24:28 GMT+08:00 2002   [info] Velocity successfully started.

After calling VelocityServlet
Fri Mar 08 12:24:40 GMT+08:00 2002   [info] Velocimacro :  VM library
template macro registration complete.
Fri Mar 08 12:24:40 GMT+08:00 2002   [info] Velocimacro : allowInline = true
: VMs can be defined inline in templates
Fri Mar 08 12:24:40 GMT+08:00 2002   [info] Velocimacro :
allowInlineToOverride = true : VMs defined inline may replace previous VM
definitions
Fri Mar 08 12:24:40 GMT+08:00 2002   [info] Velocimacro : allowInlineLocal =
false : VMs defined inline will be  global in scope if allowed.
Fri Mar 08 12:24:40 GMT+08:00 2002   [info] Velocimacro : messages on  : VM
system will output logging messages
Fri Mar 08 12:24:40 GMT+08:00 2002   [info] Velocimacro : autoload on  : VM
system will automatically reload global library macros
Fri Mar 08 12:24:40 GMT+08:00 2002   [info] Velocimacro : initialization
complete.
Fri Mar 08 12:24:40 GMT+08:00 2002   [info] Velocity successfully started.
Fri Mar 08 12:25:03 GMT+08:00 2002   [info] Velocimacro : added new VM :
#pager( ) : source = asset-select.vm
Fri Mar 08 12:25:03 GMT+08:00 2002   [info] Velocimacro : added new VM :
#javascript( ) : source = asset-select.vm
Fri Mar 08 12:25:03 GMT+08:00 2002   [info] Velocimacro : added new VM :
#pagebody( ) : source = asset-select.vm

Any clue? :)

Regards,
Kelvin

----- Original Message -----
From: "Kelvin Tan" <kelvin@relevanz.com>
To: "Velocity Users List" <velocity-user@jakarta.apache.org>
Sent: Friday, March 08, 2002 11:40 AM
Subject: Re: velocimacro.permissions.allow.inline.local.scope (again)


> ack...the weirdest thing happened. The logging mistakes went away the
moment
> I dropped the nightly build jars in. Even after I replaced them with
> velocity-dep-1.2.jar, the log messages are now correct.
>
> Using Tomcat 4.0.1, so I guess it _could_ be how it expands the jars or
> something. I really don't know, but thanks again Geir for the lightning
> response.
>
> Regards,
> Kelvin
>
> ----- Original Message -----
> From: "Geir Magnusson Jr." <geirm@optonline.net>
> To: <velocity-user@jakarta.apache.org>
> Sent: Friday, March 08, 2002 11:12 AM
> Subject: Re: velocimacro.permissions.allow.inline.local.scope (again)
>
>
> > Are you sure those properties are getting read?
> >
> > I copied the props right out of your email, and put them into a
properties
> > file for a test program, and my log says
> >
> > Thu Mar 07 22:10:03 EST 2002   [info] Velocimacro : allowInline = true :
> VMs
> > can be defined inline in templates
> > Thu Mar 07 22:10:03 EST 2002   [info] Velocimacro :
allowInlineToOverride
> =
> > true : VMs defined inline may replace previous VM definitions
> > Thu Mar 07 22:10:03 EST 2002   [info] Velocimacro : allowInlineLocal =
> true
> > : VMs defined inline will be local to their defining template only.
> > Thu Mar 07 22:10:03 EST 2002   [info] Velocimacro : messages on  : VM
> system
> > will output logging messages
> > Thu Mar 07 22:10:03 EST 2002   [info] Velocimacro : autoload on  : VM
> system
> > will automatically reload global library macros
> > Thu Mar 07 22:10:03 EST 2002   [info] Velocimacro : initialization
> complete.
> >
> >
> > With the current CVS.
> >
> > For grins, get last night's snapshot of the CVS and see if this was
> > something fixed in 1.3
> >
> > geir
> >
> >
> >
> > On 3/7/02 10:02 PM, "Kelvin Tan" <kelvin@relevanz.com> wrote:
> >
> > > Hi,
> > >
> > > I'm using Velocity v1.2 (velocity-dep-1.2.jar if it matters).
> > >
> > > In my velocity.properties file, I've set the following
> > > velocimacro.library.autoreload = true
> > > velocimacro.context.localscope = false
> > > velocimacro.permissions.allow.inline.local.scope = true
> > > velocimacro.permissions.allow.inline.to.replace.global = true
> > >
> > > However, velocity.log produces
> > >
> > > Fri Mar 08 10:50:11 GMT+08:00 2002   [info] Velocimacro : allowInline
=
> true
> > > : VMs can be defined inline in templates
> > > Fri Mar 08 10:50:11 GMT+08:00 2002   [info] Velocimacro :
> > > allowInlineToOverride = true : VMs defined inline may replace previous
> VM
> > > definitions
> > > Fri Mar 08 10:50:11 GMT+08:00 2002   [info] Velocimacro :
> allowInlineLocal =
> > > false : VMs defined inline will be  global in scope if allowed.
> > > Fri Mar 08 10:50:11 GMT+08:00 2002   [info] Velocimacro : messages on
:
> VM
> > > system will output logging messages
> > > Fri Mar 08 10:50:11 GMT+08:00 2002   [info] Velocimacro : autoload on
:
> VM
> > > system will automatically reload global library macros
> > > Fri Mar 08 10:50:11 GMT+08:00 2002   [info] Velocimacro :
initialization
> > > complete.
> > > Fri Mar 08 10:50:11 GMT+08:00 2002   [info] Velocity successfully
> started.
> > > tarted.
> > >
> > > Why is allowInlineLocal=false when I declared it to be true? I checked
> > > velocity.properties in org/apache/velocity/runtime/defaults and I'm
> pretty
> > > sure I got the keys right. Is it just the log file which is incorrect
or
> is
> > > the property not being set? Any clue anyone?
> > >
> > > Regards,
> > > Kelvin Tan
> > >
> > > Relevanz Pte Ltd
> > > http://www.relevanz.com
> > >
> > > 180B Bencoolen St.
> > > The Bencoolen, #04-01
> > > S(189648)
> > >
> > > Tel: 238 6229
> > > Fax: 337 4417
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:velocity-user-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail:
> > > <mailto:velocity-user-help@jakarta.apache.org>
> > >
> >
> > --
> > Geir Magnusson Jr.
geirm@optonline.net
> > System and Software Consulting
> > "Now what do we do?"
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:velocity-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:velocity-user-help@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:velocity-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:velocity-user-help@jakarta.apache.org>
>


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


Mime
View raw message