Angle bracket syntax

In FreeMarker 2.3.x, the recommended syntax has used < and > instead of [ and ]. For example, <#list xs as x>...</#list> and <#-- a comment -->. This syntax is still supported, and due to the syntax auto-detection you can just use it without configuring anything. You can't use both square bracket syntax and angle bracket syntax in the same template file however, as the syntax is detected for the whole template at the first [# or <# that is followed by letter or underscore, or at the first [@ or <@ (followed by anything) that occurs in the file. For example, if your first FTL tag uses <#, then any [# and [@ in the later parts of the template will be just static text. You can still include/embed/import templates that use a different syntax, since the syntax detection of the two templates are independent.

Note that the behaviour of the auto-detection can be influenced with the tag_syntax setting, i.e., with freemarker.template.Configuration.setTagSyntax(int tagSyntax).


Page generated: 2008-07-16 22:54:16 GMT FreeMarker Manual -- For FreeMarker 2.4pre1 - INCOMPLETE/OUTDATED!