// get the configuration and template
Configuration config = freemarkerManager.getConfiguration(servletContext);
Template template = config.getTemplate(decorator.getPage(), getLocale(ctx.getActionInvocation(), config)); // WW-1181
// get the main hash
SimpleHash model = freemarkerManager.buildTemplateModel(ctx.getValueStack(), null, servletContext, req, res, config.getObjectWrapper());
// populate the hash with the page
model.put("page", page);
if (page instanceof HTMLPage) {
HTMLPage htmlPage = ((HTMLPage) page);
model.put("head", htmlPage.getHead());
}
model.put("title",page.getTitle());
model.put("body",page.getBody());
model.put("page.properties", new SimpleHash(page.getProperties()));
// finally, render it
template.process(model, res.getWriter());
} catch (Exception e) {
String msg = "Error applying decorator: " + e.getMessage();