String logTag, SimpleNode nodeTree) throws IOException
{
/*
* we want to init then render
*/
InternalContextAdapterImpl ica =
new InternalContextAdapterImpl(context);
ica.pushCurrentTemplateName(logTag);
try
{
try
{
nodeTree.init(ica, this);
}
catch (TemplateInitException pex)
{
throw new ParseErrorException(pex);
}
/**
* pass through application level runtime exceptions
*/
catch(RuntimeException e)
{
throw e;
}
catch(Exception e)
{
String msg = "RuntimeInstance.render(): init exception for tag = "+logTag;
getLog().error(msg, e);
throw new VelocityException(msg, e);
}
/*
* now render, and let any exceptions fly
*/
nodeTree.render(ica, writer);
}
finally
{
ica.popCurrentTemplateName();
}
return true;
}