Browse files

Oops... forgot to process the template

  • Loading branch information...
1 parent 3c5b601 commit e5a4bd384fb671fb7909fa2a46936ce32d584a7f @luiz luiz committed Jul 12, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/main/java/br/com/caelum/vraptor/freemarker/DefaultTemplate.java
View
5 src/main/java/br/com/caelum/vraptor/freemarker/DefaultTemplate.java
@@ -28,7 +28,9 @@ public DefaultTemplate(freemarker.template.Template template, HttpServletRespons
@Override
public void render() throws IOException, TemplateException {
PrintWriter writer = response.getWriter();
- template.process(root, writer);
+ Environment processingEnv = template.createProcessingEnvironment(root, writer);
+ processingEnv.setOutputEncoding("UTF-8");
+ processingEnv.process();
writer.flush();
result.nothing();
@@ -45,6 +47,7 @@ public String getContent() throws IOException, TemplateException {
StringWriter writer = new StringWriter();
Environment processingEnv = template.createProcessingEnvironment(root, writer);
processingEnv.setOutputEncoding("UTF-8");
+ processingEnv.process();
writer.flush();
return writer.getBuffer().toString();

0 comments on commit e5a4bd3

Please sign in to comment.