In Short
I want to have switch statement in thymeleaf with logic once written to multiple case statements.
In detail
I want to implement this in the thymeleaf
switch(status.value){
case 'COMPLETE':
case 'INVALID':
//print exam is not active
break;
case 'NEW':
//print exam is new and active
break;
}
My current thymleaf code which fails with runtime error
<div th:switch="${status.value}">
<div th:case="'COMPLETE','INVALID'">
<!-- print object is not active -->
</div>
<div th:case="NEW'">
<!-- print object is new and active -->
</div>
</div>
But the above code fails with error
org.thymeleaf.exceptions.TemplateProcessingException: Could not parse as expression: "'COMPLETE','INVALID'"...
Note: I know the reason for this above error message. All I need is to know a way to implement switch with multiple cases for a single output