velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason van Zyl <jvan...@periapt.com>
Subject Re: values not in Context
Date Tue, 20 Feb 2001 16:16:23 GMT


On Tue, 20 Feb 2001, David Esposito wrote:

> Is there a way to have Velocity just print out nothing ("") for values that
> it can't find in the Context when parsing the page? Right now, it prints out
> the VTL expression $whatever if "whatever" is not in the hashtable.

You can use the quiet reference notation:

You are the $!invisible man for all seasons.

If $invisible is in the context then the value will
appear, if not you'll get "" as you wish.

jvz.


Mime
View raw message