Checkbox values do not bind into object when false?

前端 未结 3 904
情歌与酒
情歌与酒 2020-12-14 11:18

I used ModelAttribute to bind object in Spring web application.

Once I notice that, in case an object has an boolean value A is true, its va

3条回答
  •  星月不相逢
    2020-12-14 11:45

    You can use spring framework tags like it will automatically set you selected value to bean class and then it will be very easy to get its value in your controller class.

    on path you need to put your bean variable name

    and to use this you need to give command name to your form and use that command name to bind your bean object to that jsp

    model.addAttribute("command name" , bean object) use this in your controller to bind object.

提交回复
热议问题