velocity 配置文件详解
来源:互联网 发布:python 数学函数库 编辑:程序博客网 时间:2024/05/16 06:41
在velocity的发布方包中有一个velocity.properties(位于 org.apache.velocity.runtime.defaults package下,
文件定义了velocity的配置信息org.apache.velocity.runtime.RuntimeConstants中定义了key值)
#模板编码:
input.encoding=ISO-8859-1//模板输入编码output.encoding=ISO-8859-1 //模板输出编码
#foreach配置
directive.foreach.counter.name= velocityCount //计数器名称directive.foreach.counter.initial.value = 1 //计数器初始值directive.foreach.maxloops = -1 //最大循环次数,-1为默认不限制directive.foreach.iterator.name = velocityHasNex //迭代器名称
#set配置
directive.set.null.allowed = false //是否可设置空值
#include配置
directive.include.output.errormsg.start= <!-- include error : //错误信息提示开始字符串directive.include.output.errormsg.end = see error log --> //错误信息提示结束字符串
#parse配置
directive.parse.max.depth = 10 //解析深度
#模板加载器配置
resource.loader = file //模板加载器类型,默认为文件,可定义多个file.resource.loader.description= Velocity File Resource Loader //加载器描述file.resource.loader.class =Velocity.Runtime.Resource.Loader.FileResourceLoader //加载器类名称file.resource.loader.path = . //模板路径file.resource.loader.cache = false //是否启用模板缓存file.resource.loader.modificationCheckInterval = 2 //检查模板更改时间间隔
#宏配置
velocimacro.library//指定宏定义文件的位置velocimacro.permissions.allow.inline= true //是否可以行内定义velocimacro.permissions.allow.inline.to.replace.global = false //是否可以用行内定义代替全局定义velocimacro.permissions.allow.inline.local.scope = false //行内定义是否只用于局部velocimacro.context.localscope= false //宏上下文是否只用于局部velocimacro.max.depth = 20 //解析深度velocimacro.arguments.strict= false //宏参数是否启用严格模式
#资源管理器配置
resource.manager.class= Velocity.Runtime.Resource.ResourceManagerImpl //管理器类名称resource.manager.cache.class = Velocity.Runtime.Resource.ResourceCacheImpl //缓存器类名称
#解析器池配置
parser.pool.class= Velocity.Runtime.ParserPoolImpl //解析池类名称parser.pool.size = 40 //初始大小
#evaluate配置
directive.evaluate.context.class= Velocity.VelocityContext //上下问类名称
#可插入introspector配置
runtime.introspector.uberspect = Velocity.Util.Introspection.UberspectImpl //默认introspector类名称
#日志配置
runtime.log = velocity.log用以指定 Velocity 运行时日志文件的路劲和日志文件名,如不是全限定的绝对路径,系统会认为想对于当前目录.runtime.log.logsystem这个参数没有默认值,它可指定一个实现了org.apache.velocity.runtime.log.LogSystem.接口的自定义日志处理对象给 Velocity。这就方便将 Velocity 与你己有系统的日志机制统一起来runtime.log.logsystem.class= org.apache.velocity.runtime.log.AvalonLogSystem上面这行,是一个示例来指定一个日志记录器.runtime.log.error.stacktrace= falseruntime.log.warn.stacktrace= falseruntime.log.info.stacktrace= false这些是错误消息跟踪的开关.将会生成大量、详细的日志内容输出.runtime.log.invalid.references= true当一个引用无效时,打开日志输出. 在生产系统运行中,这很有效,也是很有用的调试工具.
【转载】 “java小沙弥” 博客http://leokongwq.blog.51cto.com/1310215/1401263
0 0
- velocity 配置文件详解
- Velocity详解
- velocity解析vm配置文件
- springmvc+velocity开发配置文件
- 【JAVA& Velocity】velocity配置详解
- velocity.propertity 配置详解
- Velocity布局详解(二)
- Velocity配置详解(三)
- Velocity配置详解
- Velocity初探小结--velocity使用语法详解
- velocity源码分析:初始化之配置文件
- Spring MVC整合Velocity详解
- Velocity之脚本语法详解
- 配置文件详解
- Velocity 布局laytou功能(一)-Velocity使用详解
- Velocity
- Velocity
- Velocity
- 类与对象的创建详解(适合新人)
- AspNet MVC4 教学-23:Asp.Net MVC4 Display And Editor 模板技术快速应用Demo
- 第7章 第1题
- 旋转90度也可以,Lumia的四大重置方式
- ArcGIS教程:区域填充
- velocity 配置文件详解
- ★营销QQ辅助软件如何迅速添加好友★
- thread 中join() 的用法
- Sqoop-1.4.4工具import和export使用详解
- leetcode Pow(x, n)
- struts2 jsp提交到action出现中文乱码问题
- 分享女性每月四个时期的保养重点
- 课程设计---约瑟夫环
- Step into Gradle - 01 - 基本使用