velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: checking if all variables are present
Date Tue, 28 Jul 2009 10:47:09 GMT
several possibilities:

a) You can use the experimental TemplateTool to programmatically get a list of references
to check against the context before rendering:

b) Use an buffering writer and a ReferenceInsertionEventHandler to stop rendering if something
is missing

c) Check with #if($!myvar != null) before using reference content (as in previous answer to
this thread).

Hope this helps somehow,

Captain Cid wrote:
> I have a template containing some variables to be rendered from context.
> Is there way by which i can know if all the variables are present in the
> context, otherwise throw an error.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message