velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <ge...@optonline.net>
Subject Re: catching unbound methods?
Date Sun, 13 Oct 2002 18:49:25 GMT
On 10/13/02 2:28 PM, "Nathan Bubna" <nathan@esha.com> wrote:

> Mark said:
>> Nathan said:
>>> i suggest you RTM (read the manuals) more carefully.  looking into the
> code
>>> at ASTMethod.java and such is NOT the way to begin.
>> 
>> I've read them til I'm blue in the face; they don't give any sort of
> precise
>> description of how reflection is applied nor what happens when lookup
> fails.
> 
> 
> anyway, to deal more with your complaint...  again i repeat, you were wrong
> to say that plain $somenull references in the templates cause errors or
> warnings to be logged.   null reference errors are logged ONLY when the
> $somenull or $foo.somenull reference is within a VTL directive.
> 
> now, i can see someone having cause to need or want the *option* to log
> warnings when such references are encountered, but for myself, those would
> just annoy me.  as it is, i am occasionally annoyed by the errors logged
> when i do #set( $foo = $somenull ).   i have in the past, and will continue
> to support making such VTL valid and functional (i.e. having that code set
> the $foo reference to null instead of leaving it's previous value).  so, to
> get to my point, i don't agree that the current behaviour is a big problem.
> i was just trying to explain to you what the current behaviour is since you
> seem to be confused about it.


I just want to note that you can get Velocity to tell you when it encounters
things that appear to be references ($<foo>) but don't have any backing
value.  There is a configuration parameter :

As a constant :

RuntimeConstants.RUNTIME_LOG_REFERENCE_LOG_INVALID

or as a string literal

runtime.log.invalid.references

Set this to true and Velocity should log any non-quiet reference like
thingies w/o backing data.

Geir


-- 
Geir Magnusson Jr. 
geirm@adeptra.com                                    +1-203-355-2219 (w)
Adeptra Inc.                                         +1-203-247-1713 (m)



--
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