1

It should be possible to configure freemarker to use the old #-less syntax.

However, to give users time to prepare for this change, in FreeMarker 2.1 and 2.2 the usage of # is optional, unless the programmer enables strict syntax mode in the FreeMarker configuration by calling setStrictSyntaxMode(true) on Configuration. In fact, we strongly recommend this to programmers. Starting from some later release this setting will be initially set to true. Also, you can specify if you want to use strict syntax or old syntax in the template files with the ftl directive.

How can I configure the fmpp preprocessor to use this old syntax with the Ant integration? Is there a setting or how can one call setStrictSyntaxMode(false)?

I am grateful for any assistance!

setchock
  • 151
  • 1
  • 2
  • 9

2 Answers2

1

It seems you can't... it's not exposed through FMPP's setting API. If it's any consolation, the new syntax is more practical, because it catches more typos, and because the Eclipse plugin supports it. So if you have some old templates, certainly it's better to take that 15 minutes and search-and-replace the FTL tags with the # version.

ddekany
  • 29,656
  • 4
  • 57
  • 64
1

I was able to solve this by adding an "oldSyntax" Setting myself using the "setOldTemplateSyntax" method that is offered by the Engine.

https://github.com/freemarker/fmpp/issues/20

setchock
  • 151
  • 1
  • 2
  • 9