[
https://issues.apache.org/jira/browse/VELOCITY-688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12672325#action_12672325
]
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: https://issues.apache.org/jira/browse/VELOCITY-688
> 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: [email protected]
For additional commands, e-mail: [email protected]