You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Maurice Nicholson <ma...@opodo.com> on 2005/11/17 17:35:23 UTC

Config property for silent by default

Hi all,
 
is there a Velocity config property to use silent notation by default?
 
I want to simplify authoring templates as much as possible (eg, for
non-technical people) so I'd like to always use non-silent notation like
$myVar or ${myVar} and if it's not defined, have Velocity output an empty
string.
 
Otherwise I think I'll need to use silent notation for many of my context
variable references, just in case some are not defined!
 
Many thanks,
Maurice
 
 


________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Re: Config property for silent by default

Posted by Nathan Bubna <nb...@gmail.com>.
there's no basic config property, but what you want can probably be
accomplished (i haven't tried myself) using a
ReferenceInsertionEventHandler.

http://jakarta.apache.org/velocity/docs/developer-guide.html#EventCartridge%20and%20Event%20Handlers

On 11/17/05, Maurice Nicholson <ma...@opodo.com> wrote:
> Hi all,
>
> is there a Velocity config property to use silent notation by default?
>
> I want to simplify authoring templates as much as possible (eg, for
> non-technical people) so I'd like to always use non-silent notation like
> $myVar or ${myVar} and if it's not defined, have Velocity output an empty
> string.
>
> Otherwise I think I'll need to use silent notation for many of my context
> variable references, just in case some are not defined!
>
> Many thanks,
> Maurice
>
>
>
>
> ________________________________________________________________________
> This e-mail has been scanned for all viruses by Star. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> ________________________________________________________________________
>

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