}
@Override
protected void renderTemplate(Map<String, Object> model, GrailsWebRequest webRequest, HttpServletRequest request,
HttpServletResponse response) throws Exception {
Content content = obtainContent(model, webRequest, request, response);
if (content != null) {
beforeDecorating(content, model, webRequest, request, response);
SpringMVCViewDecorator decorator = (SpringMVCViewDecorator)groovyPageLayoutFinder.findLayout(request, content);
if(decorator != null) {
decorator.render(content, model, request, response, webRequest.getServletContext());
} else {
PrintWriter writer = response.getWriter();
content.writeOriginal(writer);
if (!response.isCommitted()) {
writer.flush();
}
}
}