Fast, Modular, Easy-to-learn

A modern template engine for Spring

Modernize your Spring applications with Phoenix

Phoenix Bird

Unleash the power of Server Side Rendering

Make your applications faster and safer using server side rendering and Phoenix.

The power of Java inside your templates

Features

The `@` character

Only one special character, `@`, is used to distinguish between HTML and Java code. You can easily insert for or if, using only the @ character before them. And many more...

Create modular templates

You can easilly define fragments or templates that can be reused and imported inside other templates. Further more, you can send HTML content blocks as input parameters.

Open Source

Phoenix is fully open-source and free to use, even for commercial projects. Feel free to download the code, contribute, submit a bug or request features!

Fast, fast and fast

Phoenix templates are compiled into Java classes. This means that they are fast. Phoenix is still in early development, however it features promising results compared to other popular template engines. The resulting HTML page is quickly assembled and ready to be returned from any controller using the View.of() syntax.

Reverse routing

Phoenix supports reverse routing, meaning that endpoints are determined at runtime by the engine. If an endpoint changes in the controller you don't need to make any changes inside your template. And yes, dynamic URLs are supported.

Use Java

Phoenix was designed with Java in mind. You can import any Java class from your code or standard Java classes and use them inside your templates. Furthermore, the default Java syntax is used inside templates, so you don't need to learn utilities or special syntaxes.

Did I already say that Phoenix is fast?

Benchmarks

Some numbers

Phoenix in still in early development and things may change in the future, but at the moment it has really good benchmarks. Look at the benchmark page for more details, but Phoenix may be one of the fastest template engines currently available for Spring. In my rudimentary benchmark, Phoenix completed in under 600ms, orders of magnitude faster than Thymeleaf and even slightly faster than Rocker.

You can look over the source code for the benchmarks on Github. Feel free to improve them by adding new scenarios or other template engines.

Pages rendered in 1 second
Thymeleaf: 5,194 pages
Rocker: 157,009 pages
Phoenix: 167,785 pages

Thymeleaf

5,194 pages

Rocker

157,009 pages

Phoenix

167,785 pages

Discover more

Source code

Phoenix is fully open source. You can look over the implementation, help by adding new feature or fixing bugs, or simply spreading the word about it. Feel free to check the current roadmap and issues on Github.

Documentation

While Phoenix is easy to use and learn, it will help if you look over the documentation. Learn about all the features that Phoenix has to offer and how to properly use them.

Support Phoenix

If you want to support the project in any way, feel free to contact me using the contact form from my blog. There are still many awesome features I would like to add, so any support is greatly appreciated.