<div th:switch="${user.role}">
<p th:case="'admin'">User is an administrator</p>
<p th:case="#{roles.manager}">User is a manager</p>
</div>
Note that as soon as one th:case attribute is evaluated as true, every other th:case attribute in the same switch context is evaluated as false.
The default option is specified as th:case="*" @author Daniel Fernández @since 2.0.0
|
|