Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 1.62 KB

README.md

File metadata and controls

54 lines (40 loc) · 1.62 KB

Quarkus Freemarker

Freemarker is a very popular and mature templating engine. Its integration as a Quarkus extension provides developers ease of configuration, and offers support for native images.

To get started, add the dependency:

<dependency>
    <groupId>io.quarkiverse.freemarker</groupId>
    <artifactId>quarkus-freemarker</artifactId>
</dependency>

Add some ftl templates in src/main/resources/freemarker/templates:

Hello ${name}!

Inject the template in your code:

@Inject
@TemplatePath("hello.ftl")
Template hello;

Build a model and start rendering your template:

StringWriter stringWriter = new StringWriter();
hello.process(Map.of("name", "bob"), stringWriter);
String result = stringWriter.toString();

For more details, check the complete documentation.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Vincent Sevel

💻 🚧