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);