velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna (JIRA)" <>
Subject [jira] Commented: (VELOCITY-688) ! preceding a reference in strict mode ignores a null exception
Date Tue, 10 Feb 2009 17:15:06 GMT


Nathan Bubna commented on VELOCITY-688:

Natural is all relative.  I guess i can understand strict ref rendering $foo as empty string,
because in strict ref mode $foo is never schmoo.   But using $! to say "go boom when null"
seems really unnatural to me as a Velocity user who is used to $! meaning "this can be null".

Honestly, i think it would make more sense to have $foo throw an exception when undefined
or null and have $!foo still throw an exception when undefined but render empty string when
null.  Which, i think is how it was, right?

> ! preceding a reference in strict mode ignores a null exception
> ---------------------------------------------------------------
>                 Key: VELOCITY-688
>                 URL:
>             Project: Velocity
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: 1.7
>            Reporter: Byron Foster
>             Fix For: 1.7
> Change strict mode (runtime.references.strict = true) behavior such that when Velocity
attempts to render a reference that evaluates to null then throw an exception.  If the reference
is preceded by '$!' as in $!foo, then simply render nothing and ignore the null value as it
does for non strict mode.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message