freemarker API 之 Configuration介绍
来源:互联网 发布:淘宝女装店铺名字 编辑:程序博客网 时间:2024/05/17 06:57
摘自:http://hi.baidu.com/gzdx968342/blog/item/08bcd856f666854e1038c2c4.html
freemarker.template.Configuration
1..setDefaultEncoding(encoding) //设置缺省编码方式。比如,defaultEncode=UTF-8
2.setSharedVariable(String name, TemplateModel tm)//设置共享变量,使得java API 能在ftl文件中使用,比如,
org.apache.commons.lang.StringUtils
org.apache.commons.lang.ObjectUtils
org.apache.commons.collections.CollectionUtils
还可以导入自己的工具类等。。。
3.setSettings(Properties props) 设置一些属性,比如缓存策略
Configuration.CACHE_STORAGE_KEY=“cache_storage”
cache_storage=strong:20, soft:250
MRU Cache(Most Recently Used最近最经常使用)
双缓存,strong:20 强引用不会被从虚拟机中回收,软引用soft:250则会,当强引用满了后,会把极少用到的部分移到软引用(二级缓存)中
FreeMarker template 能在cache中缓存起来,只要创建一次就可以了
Could not find template in cache, creating new one;
Compiling FreeMarker template
4.setTemplateLoader(TemplateLoader loader)//设置模板路径
比如 "/" 代表classpath根路径
- freemarker API 之 Configuration介绍
- freemarker之new configuration
- FreeMarker之概念介绍(一)
- FreeMarker之概念介绍(一)
- osworkflow Api 之 basic and configuration
- freemarker API
- 5、Configuration构建之setting节点介绍
- freemarker介绍
- 介绍-FreeMarker
- magento custom api configuration
- Freemarker 中文API手册
- freemarker API demo
- Commons Configuration 介绍
- Commons Configuration 介绍
- Hadoop Configuration介绍
- commons-configuration使用介绍
- FreeMarker标签介绍
- Freemarker概念简单介绍
- 好看html边框样式
- 不是每个程序员都是适合创业,即使你工作了十年
- HDU 1272小希的迷宫 1325Is It A Tree? 并查集确定图为树
- 左侧栏宽度可调节(刷新后宽度会恢复)
- OpenCL和CUDA全解释
- freemarker API 之 Configuration介绍
- poj 3013(数组模拟邻接表+spfa)
- Android ApiDemos示例解析(34):App->Preferences->Preferences from code
- 你可能不了解的strtotime函数
- Xmpp初窥
- 清空FILE文件域信息
- JSP 解决illegal to have multiple occurrences of contentType with different values错误
- ios的四个核心部分
- Android应用程序的默认最大内存值