From 18a5156894596ae8a043e37e2c22de764ecf068e Mon Sep 17 00:00:00 2001 From: hongawen <83944980@qq.com> Date: Tue, 18 Apr 2023 10:41:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/njcn/event/utils/FreemarkerUtil.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/utils/FreemarkerUtil.java b/pqs-event/event-boot/src/main/java/com/njcn/event/utils/FreemarkerUtil.java index 1c255fec1..eaa9714b9 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/utils/FreemarkerUtil.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/utils/FreemarkerUtil.java @@ -25,15 +25,15 @@ public class FreemarkerUtil { public String generateString(String templateFileName, String templateDirectory, Map datas) throws IOException, TemplateException { - Configuration configuration = new Configuration(Configuration.VERSION_2_3_0); - // 设置默认编码 - configuration.setDefaultEncoding("UTF-8"); - - // 设置模板所在文件夹 - path = java.net.URLDecoder.decode(path, "utf-8"); - System.out.println("路径为:" + path); - System.out.println("templateDirectory:" + templateDirectory); - configuration.setDirectoryForTemplateLoading(new File(path + templateDirectory)); +// Configuration configuration = new Configuration(Configuration.VERSION_2_3_0); +// // 设置默认编码 +// configuration.setDefaultEncoding("UTF-8"); +// +// // 设置模板所在文件夹 +// path = java.net.URLDecoder.decode(path, "utf-8"); +// System.out.println("路径为:" + path); +// System.out.println("templateDirectory:" + templateDirectory); +// configuration.setDirectoryForTemplateLoading(new File(path + templateDirectory)); // 生成模板对象 Template template = freeMarkerConfigurer.getConfiguration().getTemplate(templateFileName);