2.3.3 - FreeMarker Manual

- Home
- Manual
- Java API

- Contribute
- Report a Bug
- Download

Manual
Previous Next

# 2.3.3

Date of release: 2005-06-23

Some new features and lot of bugfixes.

Attention:

- If you are using the Log4J logging, from now at least Log4J 1.2 is required. This is because of incompatible changes in the Log4J API.

- If you build FreeMarker yourself: from now at least JavaCC 3.2 (instead of JavaCC 2.1) and at least Ant 1.6.1 (instead of Ant 1.5.x) is required. This doesn't affect users who use the `freemarker.jar` comes with the distribution.

## Changes on the FTL side

- New built-in for formatting numbers for ``computer audience'' as opposed to human audience: `c`. It should be used for numbers that must use Java language formatting regardless of the number format and locale settings, like for a database record ID used as the part of an URL or as invisible field value in a HTML form, or for printing CSS/JavaScript numerical literals.

- New built-in for the columnar/tabular displaying of sequences: `chunk`.

- The sequence slice and substring operators now allow the omitting of the last index, in which case it defaults to the index of the last sequence item or character. Example: `products[2..]`. (Also, numerical range literals now allow the omitting of the final number, in which case it defaults to infinity. Example: `5..`.)

- Bugfix: `?replace` has worked forever if the string to replace was `""`.

## Changes on the Java side

- New template loader: `freemarker.cache.StringTemplateLoader`. It uses a `Map` with `Strings` as its source of templates. See more in the JavaDoc.

- Experimental Rhino support: FreeMarker now comes with an experimental object wrapper for Rhino (Java ECMAScript implementation): `freemarker.ext.rhino.RhinoWrapper`

- Some new utility methods for `SimpleXxx` classes: `SimpleHash.toMap()`, `SimpleSequence.toList()`.

- Bugfix: FTL literals and any other `SimpleSequnce`-s, and `SimpleHash`-es now can be used as parameters to the FreeMarker-unaware Java methods that are exposed by `DefaultWrapper` or `BeansWrapper`. That is, the method parameters are automatically converted from `TemplateTypeModel`-s to `java.util.Map` and `java.util.List` respectively.

- Bugfix: The JSP support now works in JSP 2 compliant containers as well. No, it doesn't support the new features of JSP 2 yet, it's just that the JSP 1.2 taglib support has not worked in JSP 2 containers.

- Bugfix: The `Configuration.setOutputEncoding` and `setURLEscapingCharset` methods died with `NullPointerException` when you tried to set the setting value to `null`, which is legal for these settings.

- Bugfix: `freemarker.template.utility.StringUtil.replace(...)` has worked forever if the string to replace was `""`.

- Bugfix: The Log4J logging was updated to be compatible with the upcoming Log4J 1.3. Note that now FreeMarker will need at least Log4J 1.2.

- Bugfix: FreeMarker didn't built from the source code on J2SE 1.5, because of the introduction of the `enum` keyword.

- Bugfix: The return value of `SimpleSequence.synchronizedWrapper()` was not properly synchronized. Same with `SimpleHash.synchronizedWrapper()`.

- Bugfix: Problem with `BeansWrapper` and overridden bean methods/properties. (Details: bug-tracker entry #1217661 and #1166533)

- Bugfix: Can't access JSP taglibs if `Request` attribute is defined in the data-model (Details: bug-tracker entry #1202918).

- Bugfix: Various minor parser glitches were fixed.

## Other changes

- Manual improvements, especially in the FAQ.

Previous Next