several possibilities:

a) You can use the experimental TemplateTool to programmatically get a list of 
references to check against the context before rendering:
  
http://svn.apache.org/repos/asf/velocity/engine/trunk/experimental/templatetool/TemplateTool.java

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,
Christoph

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: user-unsubscr...@velocity.apache.org
For additional commands, e-mail: user-h...@velocity.apache.org

Reply via email to