Browse Source

jfinal 3.6

James 7 years ago
parent
commit
ec44d7f24f

+ 2 - 2
src/main/java/com/jfinal/template/Engine.java

@@ -520,8 +520,8 @@ public class Engine {
 	 * Engine.addFieldGetter(1, new IsMethodFieldGetter());
 	 * 
 	 * 注:IsMethodFieldGetter 系统已经提供,只是默认没有启用。该实现类通过调用
-	 *    target.isXxx() 方法获取 target.xxx 表达式的值,其中 xxx 字段必须是
-	 *    Boolean/boolean 类型
+	 *    target.isXxx() 方法获取 target.xxx 表达式的值,其中 isXxx() 返回值
+	 *    必须是 Boolean/boolean 类型才会被调用
 	 */
 	public static void addFieldGetter(int index, FieldGetter fieldGetter) {
 		FieldKit.addFieldGetter(index, fieldGetter);

+ 2 - 0
src/main/java/com/jfinal/template/EngineConfig.java

@@ -83,6 +83,7 @@ public class EngineConfig {
 	 * Add shared function with file
 	 */
 	public void addSharedFunction(String fileName) {
+		fileName = fileName.replaceAll("\\\\", "/");
 		// FileSource fileSource = new FileSource(baseTemplatePath, fileName, encoding);
 		ISource source = sourceFactory.getSource(baseTemplatePath, fileName, encoding);
 		doAddSharedFunction(source, fileName);
@@ -261,6 +262,7 @@ public class EngineConfig {
 			throw new IllegalArgumentException("baseTemplatePath can not be blank");
 		}
 		baseTemplatePath = baseTemplatePath.trim();
+		baseTemplatePath = baseTemplatePath.replaceAll("\\\\", "/");
 		if (baseTemplatePath.length() > 1) {
 			if (baseTemplatePath.endsWith("/") || baseTemplatePath.endsWith("\\")) {
 				baseTemplatePath = baseTemplatePath.substring(0, baseTemplatePath.length() - 1);