ZPY博客

Attribute “value” is required in “input(checkbox)” tags when binding to non-boolean values

thymeleaf用th:field绑定checkbox时报下面的错

Attribute "value" is required in "input(checkbox)" tags when binding to non-boolean values

正如字面意思所说,checkbox 如果绑定的是一个非boolean型时要加上value属性,把字段类型改成boolean型即可。