Velocity stopped trying to ape WebMacro over a decade ago.

If you want to throw exceptions, turn on the strict reference mode (a
feature in Velocity 1.6) or in earlier versions, configure an event
handler to do what you wish.

On Wed, Feb 3, 2010 at 4:07 PM, Tim Pizey <[email protected]> wrote:
> Hi,
>
> I have just come across a difference in the behaviour  of WebMacro and 
> Velocity 1.5:
>
> In the following template $object is expected to be an Exception:
>
> #if( $object.Message )
> $object.Message
> #end
>
> However if it is an Integer then this does not fail with an undefined 
> property exception,
> as WebMacro does, it just silently ignores.
>
> http://velocity.apache.org/engine/devel/user-guide.html says:
>
> If a reference is used within a #if or #elseif directive without any methods 
> or properties,
> and if it is not being compared to another value, then undefined references 
> are allowed.
>
> I think that the documentation is correct and that this should throw an 
> exception.
>
>
> cheers
> Tim
>
>
>
>
> --
> We are in dialogue.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to