Skip to content

gsmet/quarkus-freemarker

 
 

Repository files navigation

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

💻 🚧

About

Quarkus Freemarker Extension

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 98.6%
  • FreeMarker 1.4%