Thymeleaf is an HTML template engine specially designed for Java-based applications. The engine comes with utility classes available on the front-end level, that can be useful in processing variables before presenting them on the website. In this article, we will present utility methods for
Boolean objects. The implementation of
Boolean utility methods can be found in the official Thymeleaf GitHub Repository.
2. Available utility methods for
Thymeleaf provides several methods to manipulate Boolean object directly on the template.
||Evaluate a condition in the same way that it would be evaluated in a th:if tag||Also works with arrays, lists or sets|
||Evaluate with negation||Also works with arrays, lists or sets|
||Evaluate and apply AND operator|
||Evaluate and apply OR operator|
In this article, we presented Thymeleaf utility methods for
Boolean objects. The utility can be useful for retrieving and comparing
Boolean variables on the website.