Date of release: 2006-06-23
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 that 2.3.7 RC1 has a long
change log, so you may want to read
that too.
Changes on the Java side
-
The
seq_contains
built-in now handlesTemplateCollectionModel
-s as well. -
Bug fixed: In 2.3.7 RC1
FreemarkerServlet
has always died withNullPointerException
during initialization.
Changes on the FTL side
-
3 new operators were added for terser missing variable handling. These operators make the
default
,exists
andif_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 withexp1?default(exp2)
, also(exp1)!exp2
is near equivalent with(exp1)?default(exp2)
. The only difference is that this new operator doesn't evaluate theexp2
when the default value is not needed. -
exp1!
is similar toexp1?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 withif_exists
the default value was an empty string and an empty list and empty hash and booleanfalse
and a transform that does nothing and ignores all parameters at the same time. -
exp1??
is equivalent withexp1?exists
, also(exp1)??
is equivalent with with(exp1)?exists
.
-
-
New built-in:
exp?substring(from, toExclusive)
, also callable asexp?substring(from)
. Getting substrings was possible for a long time likemyString[from..toInclusive]
andmyString[from..]
, butmyString?substring(from, toExclusive)
andmyString?substring(from)
has the advantage that it has an exclusive end, which is more practical. (Edit: Since 2.3.21 ranges are the preferred way again, as it hasmyString[from..<toExclusive]
.) Sequence (list) slices still has to be get with the old syntax, sincesubstring
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 thesubstring
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