1.Runtime  Log

runtime.log  =  velocity.log

用以指定 Velocity 运行时日志文件的路劲和日志文件名,如不是全限定的绝对路径,系统会认为想对于 当前目录.

runtime.log.logsystem

这个参数没有默认值,它可指定一个实现了 interface org.apache.velocity.runtime.log.LogSystem.的自定义日志处理对象给 Velocity。这就方便将 Velocity  与你己有系统的日志机制统一起来

runtime.log.logsystem.class =  org.apache.velocity.runtime.log.AvalonLogSystem

上面这行,是一个示例来指定一个日志记录器.

runtime.log.error.stacktrace =  false runtime.log.warn.stacktrace =  false runtime.log.info.stacktrace =  false 这些是错误消息跟踪的开关.将会生成大量、详细的日志内容输出.

runtime.log.invalid.references =  true

当一个引用无效时,打开日志输出.  在生产系统运行中,这很有效,也是很有用的调试工具.

2.字符集编码问题

input.encoding =  ISO-8859-1

输出模板的编码方式  (templates). 你可选择对你模板的编码方式,如 UTF-8.GBK.

output.encoding  =  ISO-8859-1

VelocityServlet 对输出流(output  streams)的编码方式.

3.#foreach()  Directive

directive.foreach.counter.name =  velocityCount

在模板中使用#foreach()  指令时,这里设定的字符串名字将做为 context key 代表循环中的计数器名, 如以上设定,在模板中可以通过 $velocityCount 来访问.

directive.foreach.counter.initial.value =  1

#foreach()  中计数器的起始值.

4.#include()  and  #parse()  Directive

directive.include.output.errormsg.start =

directive.include.output.errormsg.end =

使用#include()时,定义内部流中开始和结束的错误消息标记,如果两者都设这屯,错误消息将被输出到 流中'.但必须是两都定义.

directive.parse.maxdepth  =  10 定义模板的解析深度,当在一个模板中用#parse()指示解析另外一个模板时,这个值可以防止解析时出现 recursion 解析.

5.资源管理

resource.manager.logwhenfound =  true

定 义日志中的  'found'  务目开关.当打开时,如 ResourceManager 第一次发现某个资源时, the first time,  theresource name and  classname   of  the loader that  found it will be  noted in  the runtime log.

resource.loader  =  <name>   (default =  File)

(可以有多个以.号分开的值),可以理解为指定资源文件的扩展名.

<name>.loader.description =  Velocity  File Resource Loader

描述资源装载器名字.

<name>.resource.loader.class = org.apache.velocity.runtime.resource.loader.FileResourceLoader实现的资源装载器的类名.  默认的是文件装载器.

<name>.resource.loader.path =  .

Multi-valued key.  Will  acceptCSV  for  value.   资源位置的根目录.  当前配置会使用FileResourceLoader and JarResourceLoader   遍历目录下的所有文件以查找资源.

<name>.resource.loader.cache =  false 控制装载器是否对文件进行缓存.默认不存是为了方便开发和调试.  在生产环境布署(productiondeployment)时可设为 true 以提高性能,  这里参数 modificationCheckInterval 应设为一个有效值—以决定多久 reload 一次.

<name>.resource.loader.modificationCheckInterval =  2

当模把caching 打开时,这个以秒为单位的值指示系统多久检测一次模板是否己修改以决定是否需要,如 果设为 <=  0,  Velocity  将不做检测.

FileResourceLoader 的默认参数完整示例:

resource.loader  =  file

file.resource.loader.description =  Velocity  File Resource Loader

file.resource.loader.class = org.apache.velocity.runtime.resource.loader.FileResourceLoaderfile.resource.loader.path =  .

file.resource.loader.cache =  falsefile.resource.loader.modificationCheckInterval =  2

6.Velocima cro(宏配置)

velocimacro.library =  VM_global_library.vm

Multi-valued
key.  Will  acceptCSV  for  value.当 Velocity engine
运行时,要被载入的含有宏代码库的文件名. 所有模板都可访问宏(Velocimacros ). 这个文件位置在相对于资源文件的根目录下.

velocimacro.permissions.allow.inline =  true

Determines  of  thedefinition of  new  Velocimacros via  the#macro() directive in templates

isallowed,定义在模板中是否可用#macro()指令定义一个新的宏.  默认为 true,意味所有模板都可定义

new  Velocimacros. 注意,这个设定,如模板中的有可能替换掉全局的宏定义.

velocimacro.permissions.allow.inline.to.replace.global =  false

控制用户定义的宏是否可以可以替换 Velocity 的宏库.

velocimacro.permissions.allow.inline.local.scope =  false

控制模板中的宏的专有命名空间.When  true, 一个模板中的  #macro() directive 只能被定义它的模板

访问.  这意味者所有的宏都不能共想了,当然也不会互想扰乱、替换了.

velocimacro.context.localscope   =  false 控制 Velocimacro 的引用访问(set/get)是涉及到Context

范围还是仅在当前的 Velocimacro 中.

velocimacro.library.autoreload =  false


制宏库是否自动载入.  设为 true 时,源始的 Velocimacro  将根据是否修改过而决定是否需要 reLoad,
可在调试时很方便,不需重启你的服务器,如用参数  file.resource.loader.cache =  false 的设置一样,
主要是为方便开发调试用.

7.语义更改

runtime.interpolate.string.literals =  true

Controls 
interpolation mechanism of VTL String  Literals. Note that a VTL
StringLiteral is specifically astring   using doublequotes that  is used
in  a #set() statement,  a method

call
of a reference, aparameter  to  a VM,  or as an argument  to  a VTL
directive in  general. See the VTL reference for further   information.

8.运行时配置

parser.pool.size =  20

控制 Velocity启动是需要创建并放到池中预备使用的模 板解析器的个数 ----这只是预装 . 默认的 20 个对一般用户来说足够了.  即使这个值小了,Velocity 也会运行时根据系统需要动态增加(但增加的不会装

入池中).  新增时会在日志中输出信息

velocity.properties配置说明的更多相关文章

  1. velocity properties

    resource.loader=webapp webapp.resource.loader.class=org.apache.velocity.tools.view.servlet.WebappLoa ...

  2. log4j.properties配置说明

    log4j.properties配置说明 1. log4j配置 # ALL,DEBUG,INFO,WARN,ERROR,FATAL,OFF LOG_LEVEL=INFO log4j.rootLogge ...

  3. Spring Boot 项目 application.properties配置说明

    #======================================================================================# ★☆★☆★☆★☆★☆ ...

  4. Kafka server.properties配置说明(转)

    原文:https://my.oschina.net/infiniteSpace/blog/312890?p=1 http://www.inter12.org/archives/842 broker.i ...

  5. log4j.properties配置说明学习网址

    https://blog.csdn.net/wangzhaotongalex/article/details/51308802

  6. Velocity初探小结--Velocity在spring中的配置和使用

    最近正在做的项目前端使用了Velocity进行View层的数据渲染,之前没有接触过,草草过了一遍,就上手开始写,现在又回头细致的看了一遍,做个笔记. velocity是一种基于java的模板引擎技术, ...

  7. springmvc配置多视图 - tiles, velocity, freeMarker, jsp

    转自: http://www.cnblogs.com/shanheyongmu/p/5684595.html <!-- Velocity --> <bean id="vel ...

  8. Spring boot配置文件 application.properties

    http://www.tuicool.com/articles/veUjQba 本文记录Spring Boot application.propertis配置文件的相关通用属性 # ========= ...

  9. Velocity语言的介绍

    Velocity语言的介绍 2016-09-06 15:39:25 语言介绍 Velocity是一种Java模版引擎技术,是一个基于Java的模板引擎(template engine).她允许任何人简 ...

随机推荐

  1. 安装VM虚拟机提示 尝试创建目录 C:\Public\documents\SharedVirtual Machines 时发生错误解决方法

    把Windows Defender安全中心的“受控制文件夹的访问”给关闭了,然后就可以顺利安装上了. 作者:耑新新,发布于  博客园 转载请注明出处,欢迎邮件交流:zhuanxinxin@foxmai ...

  2. CCF CSP 201409-4 最优配餐

    CCF计算机职业资格认证考试题解系列文章为meelo原创,请务必以链接形式注明本文地址 CCF CSP 201409-4 最优配餐 问题描述 栋栋最近开了一家餐饮连锁店,提供外卖服务.随着连锁店越来越 ...

  3. Hive(八)Hive的Shell操作与压缩存储

    一.Hive的命令行 1.Hive支持的一些命令 Command Description quit Use quit or exit to leave the interactive shell. s ...

  4. File.separator与 \分隔符

    在Windows下的路径分隔符和Linux下的路径分隔符是不一样的,当直接使用绝对路径时,跨平台会暴出“No such file or diretory”的异常. 比如说要在temp目录下建立一个te ...

  5. Python爬虫个人记录(二) 获取fishc 课件下载链接

    参考: Python爬虫个人记录(一)豆瓣250 (2017.9.6更新,通过cookie模拟登陆方法,已成功实现下载文件功能!!) 一.目的分析 获取http://bbs.fishc.com/for ...

  6. SpringBoot常用配置

    前言:springboot集成了主流的第三方框架,但是需要使用springboot那一套配置方式.但是我这里只列举了非常非常常用的,可以看已发的几篇博客,慢慢会补充.当然官方文档里也有相应的配置,可惜 ...

  7. 说一说Servlet的生命周期

    servlet有良好的生存期的定义,包括加载和实例化.初始化.处理请求以及服务结束.这个生存期由javax.servlet.Servlet接口的init,service和destroy方法表达. Se ...

  8. Openstack-开发基础 stevedore学习

    在给openstack-N版加路由的时候发现怎么都无法搞定,原来现在用这个模块来处理了 stevedore是用来实现动态加载代码的开源模块.它是在OpenStack中用来加载插件的公共模块.可以独立于 ...

  9. BZOJ 4945 UOJ #317 NOI2017 游戏 2-SAT 拓扑排序

    http://uoj.ac/problem/317 https://www.lydsy.com/JudgeOnline/problem.php?id=4945 我现在的程序uoj的额外数据通过不了,b ...

  10. CentOS---网络配置详解

    一.配置文件详解 在RHEL或者CentOS等Redhat系的Linux系统里,跟网络有关的主要设置文件如下: /etc/host.conf         配置域名服务客户端的控制文件 /etc/h ...