Tiptoeing Into Templates
Explore how to build reactive web pages using Thymeleaf templates within a Spring Boot WebFlux framework. Understand the use of reactive controllers that return template names wrapped in Mono objects. This lesson guides you through creating simple, static HTML templates and configuring Spring Boot to serve them reactively, laying the foundation for dynamic web app development.
We'll cover the following...
Templates
So far, we’ve built a web controller that generates streaming JSON. That will help us get oriented with the reactive web.
That’s not all that’s needed to build web services. We often need to serve web pages. Therefore, we should turn to template libraries. When it comes to reactive programming,
It also has the bonus feature of being 100% HTML-compliant.
Check out the basic example below:
There’s not too much to analyze here:
-
The
@Controllerindicates that this is a Spring web controller, but it’s based upon templates ...