dimanche 22 avril 2018

Checkbox, set 1 or 0 instead of true false

I have problem beacuse, when I want send present in my form I got

Failed to convert value of type 'java.lang.String' to required type 
'pl.lukasz.simpleuniversity.domains.Present'; nested exception is 
org.springframework.core.convert.ConversionFailedException: Failed to convert 
from type [java.lang.String] to type [java.lang.Long] for value 'true'; nested 
exception is java.lang.NumberFormatException: For input string: "true"

Question is how change that, my checkbox will give me 1 or 0 becasue in present class I set boolean and in database I have bit(1) so I can't use string true or false

<input type="checkbox" align="left" class="form-control" th:field="* 
{present}" />




Aucun commentaire:

Enregistrer un commentaire