API / Apache FreeMarker Interview questions
What is the purpose of the FreeMarker Configuration object?
freemarker.template.Configuration is the central, application-wide settings object for FreeMarker. It is normally created once and reused for the lifetime of the application rather than per request, because it owns the template cache.
It controls things such as:
- Where templates are loaded from (via a
TemplateLoader) - The default
Locale, number format, and date/time formats - The output encoding and
ObjectWrapperused to expose Java objects - The
incompatible_improvementsversion flag andTemplateExceptionHandler
Application code obtains a compiled template with configuration.getTemplate("name.ftl"), then merges it with a data model.
More Related questions...