项目 >> Template engine >> FreeMarker

FreeMarker(Java)

FreeMarker

FreeMarker is a "template engine"; a generic tool to generate text output (anything from HTML to autogenerated source code) based on templates. It's a Java package, a class library for Java programmers. It's not an application for end-users in itself, but something that programmers can embed into their products.

FreeMarker is designed to be practical for the generation of HTML Web pages, particularly by servlet-based applications following the MVC (Model View Controller) pattern. The idea behind using the MVC pattern for dynamic Web pages is that you separate the designers (HTML authors) from the programmers. Everybody works on what they are good at. Designers can change the appearance of a page without programmers having to change or recompile code, because the application logic (Java programs) and page design (FreeMarker templates) are separated. Templates do not become polluted with complex program fragments. This separation is useful even for projects where the programmer and the HMTL page author is the same person, since it helps to keep the application clear and easily maintainable.

Homepage: http://freemarker.sourceforge.net/

Loading...

FreeMarker设计指南(2)

2、数据模型 (1)基础 l         在快速入门中介绍了在模板中使用的三种基本对象类型:scalars、hashes 和sequences,其实还可以有其它更多的能力: Ø         scalars:存储单值 Ø         hashes:充当其它对...

FreeMarker特性

1、通用目标 l         能够生成各种文本:HTML、XML、RTF、Java源代码等等 l         易于嵌入到你的产品中:轻量级;不需要Servlet环境 l         插件式模板载入器:可以从任何源载入模板,如本地文件、数据库等等 l &...

FreeMarker设计指南(1)

1、快速入门   (1)模板 + 数据模型 = 输出   l         FreeMarker基于设计者和程序员是具有不同专业技能的不同个体的观念   l         他们是分工劳动的:设计者专注于表示——创建HTML文件、图片、Web页面的其它可视化方面;程序员创...

FreeMaker一篇通

前言 Freemaker是一个强大的模板引擎,相比velocity而言,其强大的过程调用、递归和闭包回调功能让freemaker可以完成几乎所有我们所想的功能。从个人看法而言,freemaker完全有能力作为MDA的代码辅助生成工具。 本文试图越过传统的概念性介绍,通过一组例子直接把读者带入到Freemaker应用的较高层阶。 正文 大家看文章标题就应该知道,我想用一篇文章,...