Share

FreeMarker

File Release Notes and Changelog

Release Name: 2.3.7

Notes:
Maintenance release with important new features.

Changes: If you are switching from 2.3.6, and not from 2.3.7 RC1, add the change log of 2.3.7 RC1 to the list of changes. I have included the change log of 2.3.7 RC1 in this file for your convenience. Differences between 2.3.7 and 2.3.7 RC1 --------------------------------------- This release, compared to 2.3.7 RC1, contains new operators for handling null/missing variables, the "substring" built-in, and some more bugfixes. Note: Numbers inside [] are bug tracker Request ID-s. You can visit the bug-tracker here: http://sourceforge.net/tracker/?group_id=794&atid=100794 Changes on the Java side: * The "seq_contains" built-in now handles TemplateCollectionModel-s as well. * Bug fixed: In 2.3.7 RC1 FreemarkerServlet has always died with NullPointerException during initialization. Changes on the FTL side: * 3 new operators were added for terser missing variable handling. These operators make the "default", "exists" and "if_exists" built-ins deprecated. (The parser doesn't issue any warning messages when you use deprecated built-ins, and they are still working.): . exp1!exp2 is near equivalent with exp1?default(exp2), also (exp1)!exp2 is near equivalent with (exp1)?default(exp2). The only difference is that this new operator doesn't evaluate the exp2 when the default value is not needed. . exp1! is similar to exp1?if_exists, also (exp1)! is similar to (exp1)?if_exists. The difference is that with this new operator the default value is an empty string and an empty list and empty hash at the same time (multi-type variable), while with "if_exists" the default value was an empty string and an empty list and empty hash and boolean false and a transform that does nothing and ignores all parameters at the same time. . exp1?? is equivalent with exp1?exists, also (exp1)?? is equivalent with with (exp1)?exists. * New built-in: exp?substring(from, toExclusive), also callable as exp?substring(from). Getting substrings was possible for a long time like myString[from..toInclusive] and myString[from..]. This syntax is now deprecated for getting substrings (but it's still working), and instead you should use myString?substring(from, toExclusive) and myString?substring(from). Sequence (list) slices still has to be get with the old syntax, since substring only applies to strings. Please note that the ``to'' parameter is 1 greater with this new builtin, as it is an exclusive index. Further difference is that the substring built-in requires that the ``from'' index is less than or equal to the ``to'' index. So 0 length substrings are possible now, but not reversed substrings. * Bug fixed: [1487694] malfunction when the "recover" directive has no nested content Differences between 2.3.7 RC 1 and 2.3.6 ---------------------------------------- This release contains many bugfixes and FreemarkerServlet/JSP related new features. It's a Release Candidate, which means that it shouldn't be used in production environment yet. We recommend this release for development, however. Please test it! Note: Numbers inside [] are bug tracker Request ID-s. You can visit the bug-tracker here: http://sourceforge.net/tracker/?group_id=794&atid=100794 Changes on the Java side: * JSP support improvement: [1326058] Added support for DynamicAttributes (new in JSP 2.0) * JSP support improvement: Added support for pushBody()/popBody() in FreemarkerPageContext * JSP support improvement: Added support for getVariableResolver() (new in JSP 2.0). * JSP support improvement: Added support for include(String, boolean) (new in JSP 2.0). * JSP support improvement: Added support for getExpressionEvaluator() (new in JSP 2.0). However, it will need Apache commons-el in the class path, or else this method will not work (it's optional). Note that EL support is not needed in principle, since FreeMarker has it's own expression language. But some custom JSP 2 tags may still want to use this method, after all it's in the JSP 2 API. * FreemarkerServlet improvement: AllHttpScopesHashModel is now public, so you can add unlisted variables to the data-model. * FreemarkerServlet improvement: When it throws a ServletException, the J2SE 1.4 cause exception is now set under J2SE 1.4. * Bug fixed: [1469275] NullPointerException when using BeansWrapper with reloaded classes * Bug fixed: [1449467] HttpSessionHashModel is not Serializable * Bug fixed: [1435113] Error in BeanWrapper with indexed properties * Bug fixed: [1411705] Acquisition bug in TemplateCache * Bug fixed: [1459699] Tag syntax can't set with Configuration.setSetting(String, String) * Bug fixed: [1473403] ReturnInstruction.Return should be public Changes on the FTL side: * Bug fixed: [1463664] [/#noparse] is printed out