enjoy 3.6 release ^_^
This commit is contained in:
@@ -73,9 +73,9 @@ public class EngineConfig {
|
||||
addDirective("string", StringDirective.class);
|
||||
addDirective("random", RandomDirective.class);
|
||||
addDirective("number", NumberDirective.class);
|
||||
addDirective("call", CallDirective.class);
|
||||
|
||||
// Add official shared method of Template Engine
|
||||
// addSharedMethod(new Json());
|
||||
addSharedMethod(new SharedMethodLib());
|
||||
}
|
||||
|
||||
@@ -83,6 +83,7 @@ public class EngineConfig {
|
||||
* Add shared function with file
|
||||
*/
|
||||
public void addSharedFunction(String fileName) {
|
||||
fileName = fileName.replace("\\", "/");
|
||||
// FileSource fileSource = new FileSource(baseTemplatePath, fileName, encoding);
|
||||
ISource source = sourceFactory.getSource(baseTemplatePath, fileName, encoding);
|
||||
doAddSharedFunction(source, fileName);
|
||||
@@ -261,8 +262,9 @@ public class EngineConfig {
|
||||
throw new IllegalArgumentException("baseTemplatePath can not be blank");
|
||||
}
|
||||
baseTemplatePath = baseTemplatePath.trim();
|
||||
baseTemplatePath = baseTemplatePath.replace("\\", "/");
|
||||
if (baseTemplatePath.length() > 1) {
|
||||
if (baseTemplatePath.endsWith("/") || baseTemplatePath.endsWith("\\")) {
|
||||
if (baseTemplatePath.endsWith("/")) {
|
||||
baseTemplatePath = baseTemplatePath.substring(0, baseTemplatePath.length() - 1);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user