From 3ea96939f4fc3da57f727acf7f6af7f6d9bc4334 Mon Sep 17 00:00:00 2001 From: zhenggm Date: Fri, 24 Jun 2022 11:45:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=96=87=E4=BB=B6=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E6=96=B9=E5=BC=8F=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E8=AF=BB=E5=8F=96jar=E4=B8=AD=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/cc/smtweb/system/bpm/util/CodeGenerator.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/smtweb-framework/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/util/CodeGenerator.java b/smtweb-framework/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/util/CodeGenerator.java index 50a624b..c8a0fbf 100644 --- a/smtweb-framework/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/util/CodeGenerator.java +++ b/smtweb-framework/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/util/CodeGenerator.java @@ -31,17 +31,18 @@ public class CodeGenerator { private final String encode = org.apache.commons.codec.CharEncoding.UTF_8; //模板文件所在目录 - private String templatesDir; +// private String templatesDir; //模板信息 private SwMap mapTemplate; protected CodeGenerator() { - templatesDir = this.getClass().getResource("/static/template").getPath(); +// templatesDir = this.getClass().getResource("/static/template").getPath(); mapTemplate = YamlUtil.readValue(this.getClass().getResourceAsStream("/static/template/index.yaml"), SwMap.class); configuration = new Configuration(Configuration.VERSION_2_3_31); try { - configuration.setDirectoryForTemplateLoading(new File(templatesDir)); + configuration.setClassForTemplateLoading(this.getClass(), "/static/template/"); +// configuration.setDirectoryForTemplateLoading(new File(templatesDir)); configuration.setClassicCompatible(true); configuration.setDefaultEncoding(encode); configuration.setOutputEncoding(encode);