API / Apache FreeMarker Interview questions
How do you use comments in FreeMarker templates?
FTL comments use <#-- comment text -->. Everything between the markers is removed during parsing and never reaches the output, and comments can span multiple lines.
<#-- TODO: replace with the new pricing rule once QA signs off --> ${price}
This is different from an ordinary HTML comment like <!-- note -->, which FreeMarker treats as literal output text and passes straight through to the browser. Any ${...} interpolations placed inside an HTML comment are still evaluated, since FreeMarker only skips content inside its own <#-- --> syntax.
More Related questions...