jeudi 12 février 2015

Submit boolean if checkbox is checked or not. JSP

I want to send to the BackEnd if an input checkbox has been checked or not.



<input id="firstRowData" type="checkbox" class="checkbox-big" name="firstRowData" value="this_is_the_value"/>


Is this the correct way? Because I'm having an exception:


org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Boolean'; nested exception is java.lang.IllegalArgumentException: Invalid boolean value [2]


I'm reading the parameter in the Backend this way:



final Boolean firstRowData, @RequestParam(value = "firstRowData", required = false)




Aucun commentaire:

Enregistrer un commentaire