Velocity Tools 3.0 Release Notes
The Velocity team is pleased to announce the availability of Velocity Tools 3.0.
Main changes:
- Velocity Tools now relies on Velocity Engine 2.0.
- New tools: CollectionTool, JsonTool.
- Some tools have been completely rewritten: BrowserTool, ImportTool, XmlTool.
- The groupId is now
org.apache.velocity.tools
.
Here is the full list of changes:
New Features
- [VELTOOLS-88] - LinkTool could easily be modified to support current-request parameter duplication
- [VELTOOLS-119] - use "input.encoding" since 1.4
- [VELTOOLS-132] - Allow use of JSP tag libraries
- [VELTOOLS-144] - DateTool can be improved to allow cross-localization of format strings
- [VELTOOLS-156] - SortTool should allow arbitrary Comparators to be specified
- New generic LogTool to emit logs from inside templates
- Added a new JsonTool for parsing json. It is in two flavors, the generic tools one and the view tools one. The view tools flavor
allows the parsing of http query json post data.
Improvements
- [VELTOOLS-62] - New empty interfaces that allow one to enforce the scope of a tool
- [VELTOOLS-75] - Add MessageTool.get method that accepts an explicit Locale
- [VELTOOLS-81] - Patch to add escaping for property values and property keys in java properties files.
- [VELTOOLS-82] - StrutsLinkTool.setForward only sees global-forwards, not local-forwards
- [VELTOOLS-89] - LinkTool's addQueryData method should automatically add an 'ignore' so addAllParameters will ignore manually-added query data
- [VELTOOLS-90] - GHOP task: Wiki->Xdoc conversion
- [VELTOOLS-92] - New logo for VelocityTools.
- [VELTOOLS-93] - Missing infos on tools creation
- [VELTOOLS-118] - the showcase webapp should use the new tools
- [VELTOOLS-123] - Layout Servlet: Look for alternate layout in request attribute
- [VELTOOLS-155] - SerializationException in the package org.apache.velocity.tools.generic.*
- [VELTOOLS-160] - XmlTool: possibility to add NamespaceContext for XPath (find method)
- [VELTOOLS-161] - allow session toolbox serialization
- [VELTOOLS-162] - allow XI inclusion in tools.xml file
- [VELTOOLS-179] - Move JSON Simple to new fork on GH and don't shade it
- Added a custom number formats cache in ConversionUtils
- Added an EscapeTool.unurl(String) unescaping method
- DateTool reenginering: added iso and iso_tz date/datetime standard formats, added intl and intl_tz for human-readable international format (time zone displayed by id)
- Deprecated ConversionTool: date/time parsing and formatting methods belong to DateTool, while number parsing
and formatting methods belong to NumberTool ; toLocale() method is now in LocaleConfig
- Deprecated MathTool number parsing methods, which are redundant with NumberTool ones
- Deprecated SortTool, and added a CollectionTool to gather lists sorting/splitting methods
- MathTool: added bitwise operations
- XmlTool now uses the standard JRE XML parser instead of the org.jdom API ; it is now in two flavors, the generic tools one and the view tools one. The view tools flavor
allows the parsing of http query xml post data.
- ImportTool reenginering:
- the ImportSupport utility class has been splitted between o.a.v.generic.ImportSupport and o.a.v.view.ViewImportSupport
- the ImportTool now has a generic version (for remote URLs import) and a view version (for local URLs import) which cannot use remote URLs in safe mode
- the local URLs import respects the 3.1 servlets specification: query parameters of the included URL do overwrite original ones
- Correct handling and better reporting of commited responses in VelocityViewServlet.error()
- Full review of the BrowserTool implementation, update user-agents detection algorithm
- Made tools-view initialization much pickier about file accesses, to ease the use of a Java SecurityManager
- Dropped undocumented autoloaded tools feature
- Review tools-view initialization: default tools are now loaded only when asked for via the
org.apache.velocity.tools.loadDefaults
parameter (as an init or servlet parameter), which defaults to false.
- Most tools are now serializable.
- The
tools.xml
file can now use XInclude file inclusion mechanism
Tasks
- [VELTOOLS-84] - Create .jar dependency documentation as has been done with Velocity project
- [VELTOOLS-177] - Clean up inconsistencies in POMs
- [VELTOOLS-178] - Move groupId to org.apache.velocity.tools
- Switched to the SLF4J logging facade.
- Dropped unmaintained Struts tools
Bug fixes
- [VELTOOLS-59] - WebappLoader's isSourceModified() and getLastModified() sometimes fail
- [VELTOOLS-79] - Source distribution archives don't unzip into their own directories
- [VELTOOLS-85] - DESCENDING order is not preserved in SortTool
- [VELTOOLS-87] - Infinite recursion of the RenderTool.recurse(Context, String) method
- [VELTOOLS-104] - MessageFormat.format() not invoked in ResourceTool.render() if there are no arguments
- [VELTOOLS-105] - MessageTool doesn't support MessageResources the same way Struts does in terms of scoping
- [VELTOOLS-120] - velocity-view.tld is not valid
- [VELTOOLS-121] - Tests are not run with Maven
- [VELTOOLS-122] - Tests fail under Maven
- [VELTOOLS-124] - LoopTool fails to retrieve $loop.index, $loop.first etc for the last element in a collection.
- [VELTOOLS-128] - LoopTool doesn't sync correctly
- [VELTOOLS-129] - DisplayTool does not call super.configure
- [VELTOOLS-130] - ViewToolManager constructor ViewToolManager(servletContext) throws NPE always
- [VELTOOLS-131] - VelocityStruts tools dependencies should be declared as optional in velocity-tools pom file
- [VELTOOLS-133] - Move to Servlet 2.5 and JSP 2.1
- [VELTOOLS-134] - ResourceTool work not propertly when change the bundle property
- [VELTOOLS-136] - SortTool fails on null values
- [VELTOOLS-145] - StrutsLinkTool is not a drop-in replacement for previous versions because it extends view.LinkTool instead of view.tools.LinkTool
- [VELTOOLS-146] - LinkTool.relative(url) and LinkTool.absolute(url) improperly handle URLs with query strings or anchors
- [VELTOOLS-148] - LinkTool.addAllParameters causes "ignored" parameters to pollute parent link objects
- [VELTOOLS-149] - LinkTool.addRequestParams methods are difficult to use from VTL due to their String[] parameter type
- [VELTOOLS-150] - VelocityLayoutServlet allows clients to specify "layout" without performing any security checks.
- [VELTOOLS-152] - ValidatorTool generates invalid XHTML even when in XHTML mode
- [VELTOOLS-157] - Race condition when instantiating tools
- [VELTOOLS-158] - org.apache.velocity.tools.view.servlet.VelocityViewServlet line 55 super.getClass().getName()
- [VELTOOLS-168] - LinkTool doesn't handle appending params properly
- [VELTOOLS-169] - Upgrade or remove commons-collections compile dependency
- [VELTOOLS-170] - Upgrade beanutils to 1.9.3 & supress access to class and Class
- [VELTOOLS-171] - Remove Struts dependency
- [VELTOOLS-172] - Remove dependency on Apache Commons Validator
- [VELTOOLS-174] - Tools referenced via servlet configuration aren't loaded
- [VELTOOLS-175] - Velocity Tools 2.0 docs do not list Velocity 1.6.2 as a runtime dependency
- [VELTOOLS-176] - DateToolTests fails locale if not the test locale
Tests
Dependency changes
- velocity-engine updated to 2.0
- JUnit updated to 4.12
- Servlet API updated to 3.1
- Dom4j dependency dropped
- common-beanutils updated to 1.9.3
- commons-digester updated to 3.2
For notes on upgrading from Velocity Tools 2.0, see Velocity Tools 3.0 Upgrading section.