(Quick Reference)

5 FreeMarker

Version: 8.0.0-M2

5 FreeMarker

5.1 Introduction

Apache FreeMarker is a template engine for generating any kind of text output from HTML to email and others.

The Spring Framework has built-in integration for using Spring MVC with FreeMarker templates. Spring Boot provides auto-configuration support for Apache FreeMarker.

5.2 Installation

Add the grace-views-freemarker dependency to your build.gradle.

implementation "org.graceframework.views:grace-views-freemarker:8.0.0-M2"

5.3 Configuration

FreeMarker template configuration can be altered with app/conf/application.yml.

For example:

grails:
    views:
        freemarker:
            enabled: true
spring:
    freemarker:
        ...

There are a number of spring.freemarker properties that can be set if you want to customize the Freemarker template engine.

See the FreeMarker Templating Properties section of the Spring Boot Appendix.