jfinal 3.3到3.6遇到特殊字符会报错(),3.2以前就不会
报错信息如下
Template: "/inde.html". Line: 6
at com.jfinal.render.TemplateRender.render(TemplateRender.java:62)
at com.jfinal.core.ActionHandler.handle(ActionHandler.java:108)
at com.jfinal.ext.handler.ContextPathHandler.handle(ContextPathHandler.java:48)
at com.daoyou.niuniu.APPConfig$2.handle(APPConfig.java:209)
at com.jfinal.plugin.druid.DruidStatViewHandler.handle(DruidStatViewHandler.java:81)
at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
具体用法如下:
1:创建 MyEncoderFactory
public class MyEncoderFactory extends EncoderFactory {
public Encoder getEncoder() {
return new JdkEncoder(charset);
}
}
2:配置 enjoy 切换到自己的 MyEncoderFactory
public void configEngine(Engine me) {
me.getEngineConfig().setEncoderFactory(new MyEncoderFactory());
}