Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
869824e2bb | ||
|
84573be584 | ||
|
3cc94a5b32 | ||
|
3a4f4f4495 | ||
|
d250b431a4 | ||
|
5e133e7de5 | ||
|
ef39843a25 | ||
|
0e5f3b7249 |
@@ -34,9 +34,10 @@ Enjoy 是基于 Java 语言的极轻量极魔板引擎。极轻量级仅 171K
|
|||||||
```
|
```
|
||||||
|
|
||||||
**2.详细使用方法见 jfinal 手册**
|
**2.详细使用方法见 jfinal 手册**
|
||||||
read me 正在补充,详细使用文档请下载 jfinal.com 官网的 jfinal 手册[http://www.jfinal.com](http://www.jfinal.com)
|
|
||||||
|
|
||||||
**JFinal 官方网站:[http://www.jfinal.com](http://www.jfinal.com)**
|
read me 正在补充,详细使用文档见官网:[https://www.jfinal.com/doc/6-1](https://www.jfinal.com/doc/6-1)
|
||||||
|
|
||||||
|
**JFinal Enjoy 官方文档:[https://www.jfinal.com/doc/6-1](https://www.jfinal.com/doc/6-1)**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
|||||||
<artifactId>enjoy</artifactId>
|
<artifactId>enjoy</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>enjoy</name>
|
<name>enjoy</name>
|
||||||
<version>3.6</version>
|
<version>3.7</version>
|
||||||
<url>http://www.jfinal.com</url>
|
<url>http://www.jfinal.com</url>
|
||||||
<description>Enjoy is a simple, light, rapid, independent, extensible Java Template Engine.</description>
|
<description>Enjoy is a simple, light, rapid, independent, extensible Java Template Engine.</description>
|
||||||
|
|
||||||
|
@@ -26,6 +26,7 @@ import com.jfinal.template.expr.ast.FieldGetter;
|
|||||||
import com.jfinal.template.expr.ast.FieldKeyBuilder;
|
import com.jfinal.template.expr.ast.FieldKeyBuilder;
|
||||||
import com.jfinal.template.expr.ast.FieldKit;
|
import com.jfinal.template.expr.ast.FieldKit;
|
||||||
import com.jfinal.template.expr.ast.MethodKit;
|
import com.jfinal.template.expr.ast.MethodKit;
|
||||||
|
import com.jfinal.template.io.EncoderFactory;
|
||||||
import com.jfinal.template.source.ClassPathSourceFactory;
|
import com.jfinal.template.source.ClassPathSourceFactory;
|
||||||
import com.jfinal.template.source.ISource;
|
import com.jfinal.template.source.ISource;
|
||||||
import com.jfinal.template.source.ISourceFactory;
|
import com.jfinal.template.source.ISourceFactory;
|
||||||
@@ -471,6 +472,17 @@ public class Engine {
|
|||||||
return config.getEncoding();
|
return config.getEncoding();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enjoy 模板引擎对 UTF-8 的 encoding 做过性能优化,某些偏门字符在
|
||||||
|
* 被编码为 UTF-8 时会出现异常,此时可以通过继承扩展 EncoderFactory
|
||||||
|
* 来解决编码异常,具体用法参考:
|
||||||
|
* http://www.jfinal.com/feedback/5340
|
||||||
|
*/
|
||||||
|
public Engine setEncoderFactory(EncoderFactory encoderFactory) {
|
||||||
|
config.setEncoderFactory(encoderFactory);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public Engine setWriterBufferSize(int bufferSize) {
|
public Engine setWriterBufferSize(int bufferSize) {
|
||||||
config.setWriterBufferSize(bufferSize);
|
config.setWriterBufferSize(bufferSize);
|
||||||
return this;
|
return this;
|
||||||
|
@@ -28,8 +28,8 @@ public class TemplateException extends RuntimeException {
|
|||||||
super(loc != null ? msg + loc : msg);
|
super(loc != null ? msg + loc : msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TemplateException(String msg, Location loc, Throwable t) {
|
public TemplateException(String msg, Location loc, Throwable cause) {
|
||||||
super(loc != null ? msg + loc : msg, t);
|
super(loc != null ? msg + loc : msg, cause);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -133,6 +133,10 @@ public class FieldKit {
|
|||||||
|
|
||||||
getters = ret.toArray(new FieldGetter[ret.size()]);
|
getters = ret.toArray(new FieldGetter[ret.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void clearCache() {
|
||||||
|
fieldGetterCache.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -115,6 +115,10 @@ public class MethodKit {
|
|||||||
forbiddenMethods.remove(methodName);
|
forbiddenMethods.remove(methodName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void clearCache() {
|
||||||
|
methodCache.clear();
|
||||||
|
}
|
||||||
|
|
||||||
public static MethodInfo getMethod(Class<?> targetClass, String methodName, Object[] argValues) {
|
public static MethodInfo getMethod(Class<?> targetClass, String methodName, Object[] argValues) {
|
||||||
Class<?>[] argTypes = getArgTypes(argValues);
|
Class<?>[] argTypes = getArgTypes(argValues);
|
||||||
Long key = getMethodKey(targetClass, methodName, argTypes);
|
Long key = getMethodKey(targetClass, methodName, argTypes);
|
||||||
|
@@ -64,7 +64,7 @@ public class ClassPathSource implements ISource {
|
|||||||
this.classLoader = getClassLoader();
|
this.classLoader = getClassLoader();
|
||||||
this.url = classLoader.getResource(finalFileName);
|
this.url = classLoader.getResource(finalFileName);
|
||||||
if (url == null) {
|
if (url == null) {
|
||||||
throw new IllegalArgumentException("File not found : \"" + finalFileName + "\"");
|
throw new IllegalArgumentException("File not found in CLASSPATH or JAR : \"" + finalFileName + "\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
processIsInJarAndlastModified();
|
processIsInJarAndlastModified();
|
||||||
|
@@ -69,7 +69,7 @@ public class Include extends Stat {
|
|||||||
Expr expr = exprList.getExpr(0);
|
Expr expr = exprList.getExpr(0);
|
||||||
if (expr instanceof Const && ((Const)expr).isStr()) {
|
if (expr instanceof Const && ((Const)expr).isStr()) {
|
||||||
} else {
|
} else {
|
||||||
throw new ParseException("The first parameter of #include directive must be String", location);
|
throw new ParseException("The first parameter of #include directive must be String, or use the #render directive", location);
|
||||||
}
|
}
|
||||||
// 其它参数必须为赋值表达式
|
// 其它参数必须为赋值表达式
|
||||||
if (len > 1) {
|
if (len > 1) {
|
||||||
|
Reference in New Issue
Block a user