The Velocity developers would like to announce the release of Velocity Engine 1.7-beta1.
Since 1.6, there has been a lot of work. Here's an overview:
- Support macro bodies. Just call them like this: #@foo() body content #end
- Can now escape single and double quotes in strings by doubling them
- Added #[[this is included in the output but not parsed]]# syntax to replace #literal
- All #set calls are now global by default; no more implicit local namespaces (not that there were well functioning ones before). To #set a local variable, use the new provided namespaces: $foreach, $macro, $template, $evaluate, $define and $foo (would exist inside the body of #@foo() #end). These must now be used to #set any variable "locally" like this: #set( $macro.mylocal = 'foo' ). When nested, access to parent namespaces is similarly explicit (e.g. $macro.parent). Please see the change log for details.
- Enhanced #break to function anywhere and optionally accept a namespace argument when you want to break beyond the nearest scope. (e.g. #break( $macro ))
- Added bracketed index syntax: $foo[0] or #set( $foo[0] = 1 )
- #stop now ends rendering/execution of a template, not parsing of a template
- OSGI-ready manifests are now provided in the jars
- A variety of small bugfixes, performance boosts and better exceptions/logging.
- Removed very obsolete Veltag and WebMacro conversion code.
For more details on these, see the change log.
Downloads of 1.7-beta1 are available here. This should work as a drop-in replacement for Velocity 1.6.3 in most cases. Users of $velocityCount, $velocityHasNext and #literal should take note of their deprecations. Users of #stop and #break should be aware of significant changes to those features.