Summary
In the first major release since becoming a top-level Apache project, the latest Velocity 1.5 version includes enhancements to the Velocity template language, support for new data types, and fixes for security vulnerabilities and bugs.
Advertisement
The Apache Velocity project released version 1.5 of its open-source Java template library. This is the first major release since Velocity became a top-level Apache project, and is fully backward compatible with earlier Velocity versions.
Major enhancements include:
Improved syntax with new capability for decimal numbers, literal map definitions, multi-line statements, and support for automatic escaping of HTML and other special entities.
New capabilities to aid integration with other applications and web frameworks, including enhanced error reporting, a new logging subsystem, and a switch to unchecked instead of checked exceptions.
Correction of several important scalability problems, including a Least Recently Used (LRU) cache implementation and a fix to a ... race condition that could occur under heavy load conditions.
Almost all known bugs are fixed, including issues with macro recursion, a SQL injection vulnerability, several memory leaks and compile-time incompatibilities with Java 1.5 and 1.6.
How do you think the latest Velocity version compares with other Java template libraries?
Used version 1.4 to develop a standalone document generation engine (with Rtf doc as template, yikes!). It was the only open source solution I could find at the time that could do it without a JEE server. It worked fabulously because the VTL is rich enough that I was able to build a translation utility to convert our simple custom tags into VTL for more complex logic (looping, if/elseif/else) and for very complex stuff I just had the template call into Java code to generate low Rtf code.