While trying to use max function in thymeleaf I got OGNL expressionn everytime. I'm not even sure if we can use functions like max/min in thymeleaf. Tried to look for it on the documentation, but couldn't find anything resourceful. This is the code where I want to use math.max :
<div th:with="maxNumber=${#max(8,12)}">
<p th:text=${maxNumber}></p>
</div>
even tried to use it in this way also : <div th:with="maxNumber=${max(8,12)}"> that gave the same error.