You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Claude Brisson (JIRA)" <ji...@apache.org> on 2016/07/15 15:33:20 UTC

[jira] [Resolved] (VELOCITY-739) Do not throw exception for quiet references in strict reference checking mode

     [ https://issues.apache.org/jira/browse/VELOCITY-739?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claude Brisson resolved VELOCITY-739.
-------------------------------------
    Resolution: Won't Fix

We're far from a consensus towards changing the current behavior of the strict mode.

IMO, "quiet" is here to avoid printing raw reference names to output, not to silence the fact that its value is missing.

Please note that strict mode allows to *test* invalid references with:
#if($invalid) ... #end
and that 2.x versions also allow null values.

Please feel free to reopen this bug if you want to step in with new remarks.


> Do not throw exception for quiet references in strict reference checking mode
> -----------------------------------------------------------------------------
>
>                 Key: VELOCITY-739
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-739
>             Project: Velocity
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: 1.6.2
>            Reporter: Will Glass-Husain
>
> I used strict reference checking for the first time and discovered that it throws exceptions even for quiet references.
> <input class="signupInput" type="text" id="StxtFirstNames"
> name="firstName" value="$!user.firstName"/>
> org.apache.velocity.exception.MethodInvocationException: Variable
> $user has not been set at layout/slide_login.vm[line 13, column 117]
> This doesn't make sense to me.  If a template author designates a reference as quiet, it's explicitly not an error.  We're preventing the use of this convenient feature.
> It's not a hard change to fix this.  Does it break backwards compatibility if we change this?
> Incidentally, there's an identical problem for InvalidReferenceEventHandler.  I'll file a separate issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org