Secure and speedy templates
for Java and Kotlin

jte in action

Why jte?

🚀 Getting started

Create a new file src/main/jte/hello.jte:

@param String name
Hello ${name}!

Add maven dependency


Render the template:

// Tell jte where your template files are located
var codeResolver = new DirectoryCodeResolver(Path.of("src", "main", "jte"));

// Create the template engine (usually once per application)
var templateEngine = TemplateEngine.create(codeResolver, ContentType.Html);

// Render
var output = new StringOutput();
templateEngine.render("hello.jte", "World", output);

Run the program and you should see this console output:

Hello World!

Congratulations! You got jte up and running 🤘.

📚 Further reading