Basics - FreeMarker Manual

- Home
- Manual
- Java API

- Contribute
- Report a Bug
- Download

Manual
Previous Next

# Basics

First of all, be sure you have read the Getting Started chapter.

A configuration is a `freemarker.template.Configuration` object that stores your common (global, application level) settings and defines variables that you want to be available in all templates (so called shared variables). Also, it deals with the creation and caching of `Template` instances.

An application typically should use only a single shared `Configuration` instance. More precisely, typically you should have one `Configuration` instance per independently developed components (like projects, modules, etc.) that internally use FreeMarker, as each should create its own instance.

As running templates are influenced by the configuration settings, each `Template` instance has a `Configuration` instance associated with it, via the corresponding `Template` constructor parameter. Usually you obtain `Template` instances with `Configuration.getTemplate` (not by directly calling the `Template` constructor), in which case the associated `Configuration` instance will be the one whose `getTemplate` method has been called.

Previous Next