mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
FreemarkerEngine修改默认版本参数
This commit is contained in:
@@ -10,12 +10,12 @@ import cn.hutool.core.io.IoUtil;
|
||||
|
||||
/**
|
||||
* 抽象模板,提供将模板融合后写出到文件、返回字符串等方法
|
||||
*
|
||||
*
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractTemplate implements Template{
|
||||
|
||||
|
||||
@Override
|
||||
public void render(Map<?, ?> bindingMap, File file) {
|
||||
BufferedOutputStream out = null;
|
||||
@@ -26,7 +26,7 @@ public abstract class AbstractTemplate implements Template{
|
||||
IoUtil.close(out);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String render(Map<?, ?> bindingMap) {
|
||||
final StringWriter writer = new StringWriter();
|
||||
|
@@ -103,7 +103,7 @@ public class FreemarkerEngine implements TemplateEngine {
|
||||
config = new TemplateConfig();
|
||||
}
|
||||
|
||||
final Configuration cfg = new Configuration(Configuration.VERSION_2_3_28);
|
||||
final Configuration cfg = new Configuration(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS);
|
||||
cfg.setLocalizedLookup(false);
|
||||
cfg.setDefaultEncoding(config.getCharset().toString());
|
||||
|
||||
|
Reference in New Issue
Block a user