摘要: 页面达到效果 【主html页面代码】 <!-- 合作单位 版块 -->[#include 'inc_project_succ_coo.html'/]【'inc_project_succ_coo.html'代码】 【配置文件】 【application.properties】 【java类】 阅读全文
posted @ 2016-08-19 11:41 涤新云 阅读(478) 评论(0) 推荐(0) 编辑
摘要: 1 自定义标签需要实现TemplateDirectiveModel这个接口中的execute方法 实例代码如下 2 配置 UserListDirective 到spring bean xml中 3 将spring bean 设置到freemarkerConfig全局变量中去。 4 ftl文件中的访问 阅读全文
posted @ 2016-08-19 11:35 涤新云 阅读(6969) 评论(0) 推荐(1) 编辑
摘要: ava代码如下: Java代码 import freemarker.core.Environment; import freemarker.template.ObjectWrapper; import freemarker.template.TemplateDirectiveModel; /** * 阅读全文
posted @ 2016-08-19 11:32 涤新云 阅读(1772) 评论(0) 推荐(0) 编辑
摘要: 首先需要添加freemarker.jar到项目,如果项目中有spring或者spirngmvc,需要整合,首先配置freemarkerConfig,代码结构如下: 其中一下代码是用来扫描.ftl的模板文件,在/web-info/freemarker目录中 然后freemarker用ftl文件来呈现视 阅读全文
posted @ 2016-08-19 11:24 涤新云 阅读(6364) 评论(1) 推荐(1) 编辑