NIHVIVO-2693 Minor refactoring in FreemarkerEmailMessage.processTemplate(): don't need to create an Environment object to process the template, because we no longer need to add the request object as a custom attribute of the Environment. Just call Template.process() instead.

This commit is contained in:
ryounes 2011-06-17 13:59:25 +00:00
parent cc6558d3f5
commit d7f7155f1b

View file

@ -160,10 +160,7 @@ public class FreemarkerEmailMessage {
try { try {
Template template = config.getTemplate(templateName); Template template = config.getTemplate(templateName);
Environment env = template.createProcessingEnvironment(bodyMap, template.process(bodyMap, new StringWriter());
new StringWriter());
env.setCustomAttribute("request", req);
env.process();
} catch (TemplateException e) { } catch (TemplateException e) {
log.error(e, e); log.error(e, e);
} catch (IOException e) { } catch (IOException e) {