thymeleaf - Spring boot - empty validation

0

I have this code that already works:

<span class="label" th:classappend="${usuario.ativo ? 'label-success' : 'label-danger'}"> </span></td>

But now I want the following:

    <span class="label" th:classappend="${usuario == vazio ? 'label-success' : 'label-danger'}"> </span></td>

If the user is empty, the label will get label-danger

but it did not work because I was wrong ... could anyone help me?

    
asked by anonymous 18.07.2018 / 19:17

2 answers

1

I solved with: $ {strings.isEmpty (name)}

I found the answer in the link: link

    
25.07.2018 / 20:13
0

Try the modification below. If it's just this, okay. If not, you need to add more information to the question, my friend.

 <span class="label" th:classappend="${usuario == null ? 'label-success' : 'label-danger'}"> </span></td>
    
18.07.2018 / 19:28