velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Bubna <>
Subject [ANNOUNCE] Apache Velocity Engine 1.7
Date Wed, 01 Dec 2010 06:46:29 GMT
The Apache Velocity Team announces the immediate availability of the
of Apache Velocity Engine 1.7.  This release is fully compatible with
the previous release and includes significant improvements in
performance, stability and features.

Apache Velocity is well-known in the Java field as a lightweight,
easy-to-use templating library for creating dynamic web sites and
performing other text-generation tasks.

Much work in this release has gone to making Velocity more
user-friendly, adding some long-desired features and improving many
others.  Apart from this, numerous bugs were fixed (both common and
obscure), deprecation warnings were added to push people toward the
eventual 2.0 version, and performance continues to be improved.  Some
details are listed below:

* There are four new syntax features:
 - #[[ This is a literal text block.  It is not parsed, but directly
fed into the output. ]]#
 - #@yourMacro() can now have body content.  Just remember to add the
@ when calling it with a body! #end
 - You can use brackets to get and set values in lists (and arrays).
e.g. #set( $foo[2] = $bar[$i] )
 - Quotes, both single and double, may be escaped in string literals
via doubling.  e.g.  #set( $foo = "Like ""this""!" )

* There are five notable deprecations:
 - $velocityCount should be changed to $foreach.index (0-base) or
$foreach.count (1-base)
 - $velocityHasNext should be changed to $foreach.hasNext,
$foreach.last or $foreach.first
 - The #literal directive has been replaced by #[[ the much superior
textblock ]]#
 - The velocimacro.context.localscope setting is being phased out;
please get/set local #macro references as members of the optional,
context-aware and self-documenting $macro "namespace" object.  (e.g.
#set( $ = 'bar' ) and $  Enable this by setting
macro.provide.scope.control=true in your properties.
 - The directive.evaluate.context.class setting is being phased out;
please get/set local #evaluate references as members of the $evaluate
"namespace" object.  Enable this by setting
evaluate.provide.scope.control=true in your properties.

* The are three important changes:
 - The #stop directive now stops rendering instead of parsing, making
it much more useful.
 - The #break directive can now be used in any scope, not just in a
nested #foreach.  It will terminate the nearest content "block",
whether a directive, a macro body, or an entire template.
 - All templates, standard block (aka "content") directives, macros,
macro bodies, #evaluate content and #define blocks can be easily
configured to have an automatically-provided, context-aware and
self-documenting namespace reference in which you can safely and
securely #set and get any "local" references to keep them out of the
global context.

See the change log for a more complete explanation of any and all of
these, or ask us about them at

Documentation Velocity 1.7 can be found here:

The change log is here:

Apache Velocity 1.7 can be downloaded here:

For the Apache Velocity Team
 Nathan Bubna

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message