How to use thymeleaf conditions - if - elseif - else

后端 未结 6 1192
遇见更好的自我
遇见更好的自我 2021-02-07 20:04

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:19

    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.

提交回复
热议问题