API / Apache FreeMarker Interview questions
What is a FreeMarker template?
A FreeMarker template is a text file, conventionally saved with the .ftl extension, that mixes literal output text with FTL constructs: directives (<#if>, <#list>, <#macro>), interpolations (${expression}), and comments (<#-- ... -->).
A template is not executed directly. Configuration.getTemplate(name) loads its source through a TemplateLoader, parses it once into an in-memory Template object (an AST), and caches that object. Calling Template.process(dataModel, writer) then walks the AST, evaluates expressions against the supplied data model, and writes the resulting text to the given Writer.
More Related questions...