1、jfinal\com\jfinal\core\Controller.java

/**
* Render with view use default type Render configured in JFinalConfig
*/
public void render(String view) {
render = renderManager.getRenderFactory().getRender(view);
} 2、
public class JFinalConfig extends com.jfinal.config.JFinalConfig
public void configConstant(Constants constants) {
if(log.isInfoEnabled()) log.info("configConstant 视图Beetl设置");
ToolBeetl.brf.config();
constants.setRenderFactory(ToolBeetl.brf);
ToolBeetl.regiseter();
} 3、
import org.beetl.core.BeetlKit;
import org.beetl.core.GroupTemplate;
import org.beetl.core.Template;
import org.beetl.ext.jfinal3.JFinal3BeetlRenderFactory;
public static final JFinal3BeetlRenderFactory brf = new JFinal3BeetlRenderFactory();
/**
* 模板扩展
*/
public static GroupTemplate regiseter(){
DataBase dataBase = ToolDataBase.getDbMap(ConstantInit.db_dataSource_main);
String db_type = dataBase.getType(); Map<String, Object> sharedVars = new HashMap<String, Object>();
sharedVars.put("db_type", db_type); if(log.isDebugEnabled()) log.debug("注册全局web视图模板解析");
GroupTemplate mainGT = brf.groupTemplate;
if(mainGT == null){
JFinal3BeetlRenderFactory brfTemp = new JFinal3BeetlRenderFactory();
brfTemp.config();
mainGT = brfTemp.groupTemplate;
}
mainGT.registerFunction("authUrl", new AuthUrl());
mainGT.registerFunction("escapeHtml", new EscapeHtml());
mainGT.registerFunction("unEscapeHtml", new UnEscapeHtml());
mainGT.registerFunction("i18nFormat", new I18nFormat());
// mainGT.registerFunction("sqlEncode", new SqlEncode());
mainGT.registerFunction("unEscapeHtml", new UnEscapeHtml());
mainGT.registerTag("sql", SqlTag.class); mainGT.setSharedVars(sharedVars); if(log.isDebugEnabled()) log.debug("注册全局BeetlKit模板解析");
GroupTemplate kitGT = BeetlKit.gt;
kitGT.registerFunction("authUrl", new AuthUrl());
kitGT.registerFunction("escapeHtml", new EscapeHtml());
kitGT.registerFunction("unEscapeHtml", new UnEscapeHtml());
kitGT.registerFunction("i18nFormat", new I18nFormat());
// kitGT.registerFunction("sqlEncode", new SqlEncode());
kitGT.registerTag("sql", SqlTag.class); kitGT.setSharedVars(sharedVars); return mainGT;
}

												

最新文章

  1. 如何让nodejs同步操作
  2. vs.net git版本仓库使用 之解决冲突方法 原创
  3. Single Number II
  4. hdu1115(计算多边形几何重心)
  5. hadoop2.2.0伪分布式搭建2--安装JDK
  6. ABAP程序相互调用--SUBMIT
  7. 通过css实现文本超出部分以省略号(......)代替
  8. Http,Https (SSL)的Url绝对路径,相对路径解决方案Security Switch 4.2 英文帮助文档 分类: ASP.NET 2014-10-28 10:50 147人阅读 评论(1) 收藏
  9. 织梦 dedecms 中LOOP 万能标签循环 调用 arcurl标签(获取链接)
  10. Linux下安装软件心得
  11. datagridview bindingsource
  12. extjs中grid中行内文本或图片居中显示
  13. oracle 11g 64位安装32位客户端和PL/SQL
  14. twemproxy 简介
  15. 在ElasticSearch中使用 IK 中文分词插件
  16. 【PAT】B1007 素数对猜想
  17. 使用JCOOKIES创建http cookie
  18. linux串口驱动分析【转】
  19. H5页面关于android软键盘弹出顶起底部元素的解决方案
  20. Postgres重置自增长id列(reset sequence)

热门文章

  1. koa-route模块
  2. lua 时间戳和时间互相转换
  3. Android开发学习笔记-splash画面的显示
  4. jquery easyui datagrid实现单行的上移下移,以及保存移动的结果
  5. vuejs时间格式化
  6. python关键字与标识符
  7. zabbix加入TCP连接数及状态的监控
  8. windows自启动脚本
  9. 使用 requests 配置代理服务
  10. Maven编译出现“[ERROR] java.lang.OutOfMemoryError: Java heap space”