- FreeMarker
Infobox_Software
name = FreeMarker
caption =
developer = Jonathan Revusky, Attila Szegedi, Dániel Dékány, and others
latest_release_version = 2.3.14
latest_release_date = release_date|2008|09|01
latest_preview_version =
latest_preview_date =
operating_system =Cross-platform
programming_language = Java
genre = Template Engine
license = BSD-like License
website = http://freemarker.orgFreeMarker is a Java-based
template engine focusing on the MVCsoftware architecture . Although it's mostly used for Servlet-based Web Application development, it can be used for any other kind of text output, such as generating CSS, Java source code, etc. Unlike JSP, it is not dependent on the Servlet architecture or on HTTP. Thus it can be used for non-Web tasks as well. FreeMarker isFree software .History
FreeMarker has a somewhat hectic history, caused by paradigm shifts and other significant changes at multiple occasions. FreeMarker 1 (now known as FreeMarker Classic, a separate project) was originally written by Benjamin Geer and Mike Bayer. From 2002, the new project lead was Jonathan Revusky, who released FreeMarker 2, which started a sequence of several substantial changes. The main aim of the changes was to make the template language more strict, i.e., to detect as many of the typos and other typical mistakes as early as possible. Also, the automatic object wrapping was introduced, along with the gradual advancement of the type system of the template language. Last but not least, the language has gained a lot of power-user features, such as more powerful macro programming capabilities. The language didn't reach a reasonably settled state until version 2.3, released in 2004 Q3. Since then, the product has remained fully backward compatible, however some not entirely backward compatible changes are still expected in 2.4, which is expected to be released in 2008 Q4.
Example
The following template:
processed by FreeMarker will produce something like:
Variables like "name" and "messages" are coming from outside the template, and thus the template author has to deal with the presentation issues only. The template remains the same regardless if these variables are coming from a database or from a cookie or calculated on whatever other ways. Also the exact Java
API (and hence the class) of the values can be hidden in FreeMarker using a technique called object wrapping. Like, certainly "messages" is a list or array of Java beans that have "from" and "body" properties, but it might be as well something very different, and the template is not affected (as far as a proper object wrapper is used).ee also
*JSP
*Apache Velocity External links
* [http://freemarker.org FreeMarker]
* [http://fm-classic.sourceforge.net/ FreeMarker Classic]
* [http://fmpp.sourceforge.net FMPP] , is a FreeMarker-based text file PreProcessor.
* [http://www.eclarus.com Use FreeMarker to generate a WORD document from a BPMN model]
Wikimedia Foundation. 2010.