On this page
2.3.5
Date of release: 2006-03-11
This release was withdrawn because of a serious bug in it. Please don't use it! Of course, all new features of it are included in FreeMarker 2.3.6.
A few new features and several bugfixes.
Changes on the FTL side
Bug fixed: [1435847] Alternative syntax doesn't work for comments
Bug fixed: With the new square bracket syntax, the tag could be closed with
>. Now it can be closed with]only.Bug fixed: [1324020]
ParseExceptionwith theftldirective if it wasn't in its own lineBug fixed: [1404033]
evalbuilt-in fails with hash concatenation
Changes on the Java side
A new
Configurationlevel setting,tagSyntaxwas added. This determines the syntax of the templates (angle bracket syntax VS square bracket syntax) that has noftldirective in it. So now you can choose to use the new square bracket syntax by default. However, the recommended is to use auto-detection (yourConfig.setTagSyntax(Configuration.AUTO_DETECT_TAG_SYNTAX)), because that will be the default starting from 2.4. Auto-detection chooses syntax based on the syntax of the first FreeMarker tag of the template (could be any FreeMarker tag, not justftl). Note that as with the previous version, if a the template usesftldirective, then the syntax of theftldirective determines the syntax of the template, and thetagSyntaxsetting is ignored.Now
BeansWrapper,DefaultObjectWrapperandSimpleObjectWrappersupport lookup with 1 character long strings inMap-s (likemyHash["a"]) that useCharacterkeys. Simply, as a special case, when a hash lookup fails on a string that is 1 character long, it checks for theCharacterkey in the underlying map. (Bug tracker entry [1299045] FreeMarker doesn't support map lookup with Character keys.)A new property,
strictwas added toBeansWrapper,DefaultObjectWrapperandSimpleObjectWrapper. If this property istruethen an attempt to read a bean propertly in the template (likemyBean.aProperty) that doesn't exist in the bean class (as opposed to just holdingnullvalue) will causeInvalidPropertyException, which can't be suppressed in the template (not even withmyBean.noSuchProperty?default('something')). This way?default('something')and?existsand similar built-ins can be used to handle existing properties whose value isnull, without the risk of hiding typos in the property names. Typos will always cause error. But mind you, it goes against the basic approach of FreeMarker, so use this feature only if you really know what are you doing.Bug fixed: [1426227]
NullPointerExceptioninprintStackTrace(...)Bug fixed: [1386193] Division by zero in
ArithmeticEngine