th:href="@{'/tasks'+${(type != 'ia')? '/inactiveList' : ''}}"
In the above snippet of the code the word type is model attribute from
rest api, if type is not equal to ia then the link will be
/tasks if type is equal to ia then the link with be
/tasks/inactiveList
th:href with if else condition in thymeleaf
In this article we are going to see how to add hyper link to anchor tag based on
if else conditions in thymeleaf
Post a Comment
Post a Comment