You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Geir Magnusson Jr." <ge...@optonline.net> on 2001/07/27 00:10:27 UTC

Re: How to avoid VM_global_library.vm

Tal Dayan wrote:
> 
> We get error "unable to find resource 'VM_global_library.vm'".
> 
> Is there a way to avoid this error, for example by setting a
> property in the Properties object we pass to Velocity.init().

Yes - you should be able to clear the value of

"velocimacro.library" 

and if that doesn't work (and I want that to work - so if it doesn't I
will fix it) you could just have a blank file 'VM_global_library.vm'
sitting in the template path, which isn't a great solution, but would
stop it until we resolve if/fix the above.

> Currently we had an hack in our logger that errors with this specific
> text (yuck).

Yuck indeed.

geir

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
Be well, do good work, and keep in touch.

Re: How to avoid VM_global_library.vm

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Tal Dayan wrote:
> 
> >
> > Try it with  all clear/set and init() and see what happens.
> >
> 
> I am not sure what you meen here ;-)

What I mean is that I suspect that you won't be able to combine
setProperty() with init(Properties).

Rather, just stick to setProperty() / clearProperty() right now (until
we fix this if there is indeed a problem...)

You can iterate over the keys in your Properties and setProperty() each
value.

> 
> Another aproach would be to ignore this property if its value is empty ("")
> so
> I can set it to an empty sting in the properties that are passed to
> Velocity.Init (the properties
> cannot be set to null, otherwise we could use this value instead).

Done.  I just checked in code into CVS that will not try to load the
library if it's an empty string.

so

velocimacro.library=

will quiet the log output.  Either update from the CVS, or wait until
tonights snapshot is created, which is now working. One word of caution
- note the *time* that the snapshot is created, as the snapshots are
getting created in early morning, so you have to wait until tonight's
which will have tomorrows date...

geir


-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
Be well, do good work, and keep in touch.

RE: How to avoid VM_global_library.vm

Posted by Tal Dayan <ta...@zapta.com>.
>
> Try it with  all clear/set and init() and see what happens.
>

I am not sure what you meen here ;-)

Another aproach would be to ignore this property if its value is empty ("")
so
I can set it to an empty sting in the properties that are passed to
Velocity.Init (the properties
cannot be set to null, otherwise we could use this value instead).

Tal

> -----Original Message-----
> From: gmj@mta6.srv.hcvlny.cv.net [mailto:gmj@mta6.srv.hcvlny.cv.net]On
> Behalf Of Geir Magnusson Jr.
> Sent: Friday, July 27, 2001 3:54 AM
> To: velocity-user@jakarta.apache.org
> Subject: Re: How to avoid VM_global_library.vm
>
>
> Tal Dayan wrote:
> >
> > I tried to call
> >
> >   Velocity.clearProperty("velocimacro.library");
> >
> > before and after the call to Velocity.init(myProps) but it does not
> > seem to change. Is this is how I should clear the property ?
>
> I'm suspicious of the technique of using clear/set and then
> init(Properties).
>
> Try it with  all clear/set and init() and see what happens.
>
> Unless there is some good reason why not, we should allow your technique
> also.
>
> geir
>
> --
> Geir Magnusson Jr.                           geirm@optonline.net
> System and Software Consulting
> Developing for the web?  See http://jakarta.apache.org/velocity/
> Be well, do good work, and keep in touch.
>


Re: How to avoid VM_global_library.vm

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Tal Dayan wrote:
> 
> I tried to call
> 
>   Velocity.clearProperty("velocimacro.library");
> 
> before and after the call to Velocity.init(myProps) but it does not
> seem to change. Is this is how I should clear the property ?

I'm suspicious of the technique of using clear/set and then
init(Properties).

Try it with  all clear/set and init() and see what happens.

Unless there is some good reason why not, we should allow your technique
also.

geir

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
Be well, do good work, and keep in touch.

RE: How to avoid VM_global_library.vm

Posted by Tal Dayan <ta...@zapta.com>.
I tried to call 

  Velocity.clearProperty("velocimacro.library");

before and after the call to Velocity.init(myProps) but it does not
seem to change. Is this is how I should clear the property ?

Tal


> -----Original Message-----
> From: gmj@mta4.srv.hcvlny.cv.net [mailto:gmj@mta4.srv.hcvlny.cv.net]On
> Behalf Of Geir Magnusson Jr.
> Sent: Thursday, July 26, 2001 3:10 PM
> To: velocity-user@jakarta.apache.org
> Subject: Re: How to avoid VM_global_library.vm
> 
> 
> Tal Dayan wrote:
> > 
> > We get error "unable to find resource 'VM_global_library.vm'".
> > 
> > Is there a way to avoid this error, for example by setting a
> > property in the Properties object we pass to Velocity.init().
> 
> Yes - you should be able to clear the value of
> 
> "velocimacro.library" 
> 
> and if that doesn't work (and I want that to work - so if it doesn't I
> will fix it) you could just have a blank file 'VM_global_library.vm'
> sitting in the template path, which isn't a great solution, but would
> stop it until we resolve if/fix the above.
> 
> > Currently we had an hack in our logger that errors with this specific
> > text (yuck).
> 
> Yuck indeed.
> 
> geir
> 
> -- 
> Geir Magnusson Jr.                           geirm@optonline.net
> System and Software Consulting
> Developing for the web?  See http://jakarta.apache.org/velocity/
> Be well, do good work, and keep in touch.
>