模板引擎 Velocity Engine 2.1 已发布,上个版本 2.0 的推出时间是两年前。
更新内容如下
- 引入新的 VTL 语法:alternate reference values: ${foo|'foo'} evaluates to 'foo' whenever boolean evaluation of $foo is false.
- 引入新的 VTL 语法:Default block for empty loops: #foreach($i in $collection) ... #else nothing to display #end
- 另外两个向后兼容 Engine 1.7 的标志, parser.allow_hyphen_in_identifier 和 velocimacro.arguments.literal
- Velocity Engine 2.1 现在要求 Java 1.8+
有关更改的完整列表,请参阅 Velocity Engine 2.1 更改部分和 JIRA 更改日志。
有关从 Velocity 1.x 升级的注意事项,请参阅 Velocity Engine 2.1 升级部分。