How to use th:if

Asked

Viewed 427 times

1

Good morning, someone would tell me the correct way to use Thymeleaf’s "th:if" with Spring MVC, I’m trying this way but I’m not getting it ..

th:if="${situacao_financeira} eq 'A'"
  • boy.... I think that’s it: th:if="${situacao_financeira == 'A'}"

  • You can solve .. I created a method in the class testing if the situation .. if it was paid true return if false .. with this I managed to control ..

1 answer

1

It was as follows:

In the model:

public boolean aPagar() {
        if(situacao_financeira.equals("A"))
            return true;
        else
            return false;
    }

and at the View

<div class="form-group" th:if="${inscricao.aPagar()}">

Browser other questions tagged

You are not signed in. Login or sign up in order to post.