Thymleaf switch statement with multiple case

前端 未结 2 1539
清歌不尽
清歌不尽 2021-02-18 15:42

In Short

I want to have switch statement in thymeleaf with logic once written to multiple case statements.

In detail

I

2条回答
  •  忘掉有多难
    2021-02-18 16:28

    The failure is due to the fact that you don't have a valid expression in the first case. Specifically,

    'COMPLETE','INVALID'
    

    is not a valid expression. I suspect that what you are trying to do is include the div if the status is COMPLETE or INVALID. Unfortunately, I believe you will have to duplicate the markup for those conditions individually. Let me suggest the following markup:

    
    
        

    Alternatively you could resort to th:if which might actually work better in this case:

    Or even more simply:

提交回复
热议问题