@Override
protected void renderTemplate(Map<String, Object> model, GrailsWebRequest webRequest, HttpServletRequest request,
HttpServletResponse response) {
request.setAttribute(GrailsLayoutDecoratorMapper.RENDERING_VIEW, Boolean.TRUE);
GSPResponseWriter out = null;
try {
out = createResponseWriter(webRequest, response);
template.make(model).writeTo(out);
}
catch (Exception e) {
out.setError();
handleException(e, templateEngine);
}
finally {
if (out != null) {
out.close();
}
}
}