load value in empty front form without starting with 0 [java] Thymeleaf + spring

Asked

Viewed 178 times

0

carregar imagem sem valor 0

my Entity is as integer and load n front with value 0, I think it is a simple thing but I do not understand much.

1 answer

1

To solve just initialize Entity with null value, so nothing will be displayed. Simple like this.

// Inicializa integer com valor igual a null.
Integer entity = null;
  • I’m sorry but my n accepted of error. @Notnull //Line break// @Column(name = "quantity_vacancies") //Line break// private int quantityVagas ;

  • Ahh, you put @Notnull, then you won’t even accept it. Put the code in the question to facilitate the answers.

  • But so, to appear empty only has two forms: Removes @Notnull and adds the required in the fields to validate in JSF or transforms the fields into String and assigns the empty string to them.

  • okay, thank you .

Browser other questions tagged

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