A template engine combines a view template with data from a controller to render a dynamic page. The same view can display different content for different requests. section 8.0 section 8.4
In a Spring MVC app, the basic flow is:
- Add a template engine dependency, then place view data in the controller’s Model using named attributes. section 8.1
- Return the view name; the template uses the attribute names to display the supplied values. section 8.1
A personalized greeting
A controller supplies the username “Katy” and color “red”; a Thymeleaf HTML template displays the name in that color. section 8.1
Figure 8.1 A dynamic view presented with the Manning shopping cart functionality. Even if the requested page is the same, the content of the page is different. The backend sent different data in the HTTP response before and after adding one more product to the cart.

The cart illustration shows how one view can display a different product list as the cart changes. section 8.1





