}
if (templateProcessor.hasTemplate(templateName)) {
response.setContentType(Format.valueOf(format.toUpperCase()).mimetype());
response.setContentEncoding("utf-8");
addCacheControlHeaders(response, params);
templateProcessor.process(templateName, model, response.getWriter());
} else {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
response.getWriter().write(String.format("Could not find template: %s", templateName));
}
}