protected void renderTemplate(String template, WebuiBindingContext bcontext) throws Exception
{
bcontext.put("decorator", decorator_);
WebuiRequestContext context = bcontext.getRequestContext();
ExoContainer pcontainer = context.getApplication().getApplicationServiceContainer();
TemplateService service = (TemplateService)pcontainer.getComponentInstanceOfType(TemplateService.class);
ResourceResolver resolver = bcontext.getResourceResolver();
if (PropertyManager.isDevelopping())
{
WebuiRequestContext rootContext = (WebuiRequestContext)context.getParentAppRequestContext();
if (rootContext == null)
rootContext = context;
long lastAccess = rootContext.getUIApplication().getLastAccessApplication();
if (resolver.isModified(template, lastAccess))
{
if (log.isDebugEnabled())
log.debug("Invalidate the template: " + template);
service.invalidateTemplate(template, resolver);
}
}
try
{
if (bcontext.getWriter() instanceof HtmlValidator)
{
HtmlValidator validator = (HtmlValidator)bcontext.getWriter();
validator.startComponent();
}
service.merge(template, bcontext);
if (bcontext.getWriter() instanceof HtmlValidator)
{
HtmlValidator validator = (HtmlValidator)bcontext.getWriter();
validator.endComponent();
}