Skip to content

Commit

Permalink
设置模板编码utf-8
Browse files Browse the repository at this point in the history
  • Loading branch information
mars05 committed Sep 25, 2019
1 parent 054421a commit d60819a
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
import freemarker.template.Configuration;

public class FreemarkerConfiguration extends Configuration {
private String basePackagePath;
private String basePackagePath;

public FreemarkerConfiguration() {
this("");
}
public FreemarkerConfiguration() {
this("");
}

public FreemarkerConfiguration(String basePackagePath) {
super(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS);
setClassForTemplateLoading(getClass(), basePackagePath);
}
public FreemarkerConfiguration(String basePackagePath) {
super(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS);
setDefaultEncoding("UTF-8");
setClassForTemplateLoading(getClass(), basePackagePath);
}
}

0 comments on commit d60819a

Please sign in to comment.