FreeMarker

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.org

FreeMarker is a Java-based template engine focusing on the MVC software 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 is Free 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:

Hello ${name}! You have the following messages:<#list messages as m>

${m.from}: ${m.body}

processed by FreeMarker will produce something like:

Hello Joe! You have the following messages:

Tim: Please don't forget to bring the conference papers!

Cindy: Can you give me visit afternoon?

Richard: Man, this time don't forget the papers!

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.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • FreeMarker — Entwickler Jonathan Revusky, Attila Szegedi, Dániel Dékány e.a. Aktuelle Version 2.3.16 (8. Dezember 2009) Betriebssystem plattformunabhängig Programmier­sprache Ja …   Deutsch Wikipedia

  • FreeMarker — Тип Шаблонизатор Разработчик Jonathan Revusky, Attila Szegedi, Dániel Dékány и другие Написана на Java Операционная система Крос …   Википедия

  • Freemarker — Dernière version 2.3.16 (7 décembre 2009) [ …   Wikipédia en Français

  • Circumflex (Scala) — Circumflex Тип Web Фреймворк, ORM Разработчик Окунский Б.С., Лахтин С.Е. Написана на Scala Операционная система Cross platform (JVM) Аппаратная платформа …   Википедия

  • Template processor — A template processor (also known as a template engine or a template parser )is software or a software component that is designed to combine one or more templates with a data model to produceone or more result documents.cite book last = Niemeyer… …   Wikipedia

  • Templatesprache — Eine Template Engine (von engl. Vorlage und Antrieb, Motor) ist eine Software, die eine Datei (das Template) verarbeitet, und bestimmte Platzhalter darin mit jeweils aktuellen Inhalten füllt. Die Bezeichnungen Templateklasse und Templatesystem… …   Deutsch Wikipedia

  • Templatesystem — Eine Template Engine (von engl. Vorlage und Antrieb, Motor) ist eine Software, die eine Datei (das Template) verarbeitet, und bestimmte Platzhalter darin mit jeweils aktuellen Inhalten füllt. Die Bezeichnungen Templateklasse und Templatesystem… …   Deutsch Wikipedia

  • FTL — may refer to: *FTL For The Loss opposite of FTW For The Win Commonly used as internet slang. * FTL For The Lads . Affectionate term used mainly in Dundee by resident males in reference to the completion of the job or Job Done . * Faster than… …   Wikipedia

  • Template engine (web) — A (web) template engine is software that is designed to process web templates and content information to produce output web documents. It runs in the context of a template system.pecific types of template engines Template engine is ordinarily… …   Wikipedia

  • WebWork — Infobox Software name = Webwork developer = OpenSymphony latest release version = 2.2.6 latest release date = release date|2007|07|21 operating system = Cross platform programming language = Java (programming language) status = Unmaintained genre …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”