From 6acdb7e09fd489bf7738097494fdaa9870177797 Mon Sep 17 00:00:00 2001 From: hongawen <83944980@qq.com> Date: Tue, 18 Apr 2023 09:49:37 +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 --- .../src/main/java/com/njcn/event/utils/FreemarkerUtil.java | 5 +++-- 1 file changed, 3 insertions(+), 2 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 145f9ba93..a705b6a08 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 @@ -20,12 +20,13 @@ public class FreemarkerUtil { public static 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"); + path = java.net.URLDecoder.decode(path, "utf-8"); + System.out.println("路径为:" + path); + System.out.println("templateDirectory:" + templateDirectory); configuration.setDirectoryForTemplateLoading(new File(path + templateDirectory)); // 生成模板对象