How to use thymeleaf conditions - if - elseif - else

后端 未结 6 1295
刺人心
刺人心 2021-02-07 19:44

I have a little problem, I must return a different choice of a select into a td using thymeleaf, I try the next sentence:



        
6条回答
  •  悲哀的现实
    2021-02-07 20:28

    I think the solution is to use the switch statement, from Thymeleaf documentation:

    User is an administrator

    User is a manager

    User is some other thing

    There isn't any other structure to use in Thymeleaf, although you could use th:if/th:unless. Check this thread in the thymeleaf forum.

提交回复
热议问题