FreeMarker (Apache)


Apache FreeMarker is a template engine: a Java library to generate text output (HTML web pages, e-mails, configuration files, source code, etc.) based on templates and changing data. Templates are written in the FreeMarker Template Language (FTL), which is a simple, specialized language.


The version of FreeMarker embedded in Platform 6 is configuration compatible with FreeMarker version 2.3.21.


Binding name: fm

Method: String process(String templateText, Map model)

Process a FreeMarker template and data model, returning the result as a String.


def model = [
    user: 'Jon Doe',
    latestProduct: [
        name: 'platform6',
        url: ''

def html = fm.process(resource.get('FMTEMPLATE'), model)
println html


  <h1>Welcome ${user}!</h1>
  <p>Our latest product:
  <a href="${latestProduct.url}">${}</a>