samedi 28 février 2015

Use instanceof in Thymeleaf

Is there a way to use the Java instanceof operator in Thymeleaf?


Something like:



<span th:if="${animal} instanceof my.project.Cat" th:text="A cat"></span>
<span th:if="${animal} instanceof my.project.Dog" th:text="A dog"></span>

Aucun commentaire:

Enregistrer un commentaire