1. Rocker

Rocker is a Java 8 optimized, memory efficient, speedy template engine producing statically typed, plain java objects.

1.1. Usage

1) Add the dependency:

Maven
Gradle
<dependency>
  <groupId>io.jooby</groupId>
  <artifactId>jooby-rocker</artifactId>
  <version>2.0.5</version>
</dependency>

2) Configure code generator

Maven
Gradle
<plugin>
    <groupId>com.fizzed</groupId>
    <artifactId>rocker-maven-plugin</artifactId>
    <version>1.2.1</version>
    <configuration>
        <templateDirectory>src/rocker</templateDirectory>
    </configuration>
    <executions>
        <execution>
            <id>generate-rocker-templates</id>
            <phase>generate-sources</phase>
            <goals>
                <goal>generate</goal>
            </goals>
        </execution>
    </executions>
</plugin>
Complete code generator options are available here

3) Write your templates inside the src/rocker/views folder

src/rocker/views/index.rocker.html
@args (String message)

<p>Hello @message!</p>

4) Install and use rocker templates

Java
Kotlin
import io.jooby.rocker.RockerModule;

{
  install(new RockerModule());              (1)

  get("/", ctx -> {
    return views.index.template("Rocker");  (2)
  });
}
1 Install Rocker
2 Returns a rocker view