templateLoc = (String) _templateResolver.resolve(comObject.getClass());
}
}
if (templateLoc == null)
{
throw new RenderingException("Cannot resolve rendering template for " + comObject);
}
if (_debugTemplate)
{
writer.write("\n<!-- start " + templateLoc + " for " + comObject + "-->\n");
}
getProcessor().process(templateLoc, writer, getEnvironment(context, peer));
if (_debugTemplate)
{
writer.write("\n<!-- end " + templateLoc + " for " + comObject + "-->\n");
}
writer.flush();
} catch (Exception e)
{
if (!_resumeOnException)
{
if (e instanceof RenderingException)
{
throw (RenderingException) e;
} else if (e.getCause() instanceof RenderingException)
{
throw (RenderingException) e.getCause();
} else
{
throw new RenderingException("Error rendering " + comObject, e);
}
} else
{
try
{