This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Spring and the fly likes Spring MVC checkbox issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring MVC checkbox issue" Watch "Spring MVC checkbox issue" New topic
Author

Spring MVC checkbox issue

sachin yadav
Ranch Hand

Joined: Nov 24, 2005
Posts: 156
I have an array of checkbox which are rendered on the JSP. Checkbox works just fine but when i post the JSP on controller i am not getting just those checkbox which are clicked but all along with bind path variable which is always false, while it should be true if checked. Due to this i am not able to figure out which box were checked and which were unchecked on the page. Here is my JSP -



Page model attribute is mainVO which contains sizeVO list. SizeVo has properties like id, name, price ect. In controller if i print i am getting following


I want only those checkboxes to bind which are checked, not all of them.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Spring MVC checkbox issue
 
Similar Threads
Using checkbox on Spring 2.5 MVC ?
how to map list of object from jsp to command object in spring
List of checkboxes and Array/ArrayList data binding not working.
How to check list of checkboxes during form load
Check box with Spring MVC