Understanding the layers of the application
Now we understand how Spring Boot is configured we will look at the layers of our example application. The following sections illustrate the general patterns applied in each layer and how we have implemented them.
The presentation layer
Thymeleaf is designed to be as unobtrusive as possible, so instead of embedding Java in tags like in JSP or using tag-based expression languages, we declare XML namespaces that add attributes to HTML tags and make the Thymeleaf expression language very unobtrusive. This also means that the templates created with Thymeleaf can be opened locally in a web browser and render correctly. The following fragment shows how we add core Thymeleaf to a template as well as the security extras, which provides attributes for accessing the security context. The th
namespace enables the th:fragment
attribute, which we use in layout.html
to specify that this particular template is a layout that can be used by other templates...