{"id":12756,"date":"2013-05-13T13:00:34","date_gmt":"2013-05-13T10:00:34","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=12756"},"modified":"2013-05-13T06:53:51","modified_gmt":"2013-05-13T03:53:51","slug":"spring-mvc-form-handling-vol-3-checkboxes-processing","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-form-handling-vol-3-checkboxes-processing.html","title":{"rendered":"Spring MVC: form handling vol. 3 \u2013 checkboxes processing"},"content":{"rendered":"<p>I have already published the post about <a title=\"Spring MVC: form handling vol. 2 \u2013 checkbox processing\" href=\"http:\/\/fruzenshtein.com\/spring-mvc-form-checkbox\/\" target=\"_blank\">processing of \u2018checkbox\u2019 tag<\/a> using Spring MVC tag library. Now I want to develop this theme and proceed with the \u2018checkboxes\u2019 tag. It\u2019s not much harder, but in some cases you\u2019d better to use it. In this article I will provide examples of Spring \u2018checkboxes\u2019 tag in conjunction with java.util.List and java.util.Map, so be ready to examine two examples.<img decoding=\"async\" class=\"alignright\" alt=\"\" src=\"http:\/\/fruzenshtein.com\/wp-content\/uploads\/2013\/04\/Spring-MVC-checkbox.png\" width=\"256\" height=\"256\" \/><\/p>\n<p>Before I start demonstrate the examples, I want to talk about a purpose of the \u2018checkboxes\u2019 tag. So when you should use it? The answer is obvious, if you want to generate your checkboxes in a runtime<br \/>\n&nbsp;<br \/>\nyou have to use the \u2018checkboxes\u2019 tag. This will help you to avoid hardcoded values in JSPs. The \u2018checkboxes\u2019 tag can collaborate with arrays and java.util.Collection\u2019s. Further I\u2019m going examine two cases with the List and Map.<\/p>\n<h2>List and \u2018checkboxes\u2019 tag<\/h2>\n<p>The first example will be with the List. As in previous article I have to create a POJO and declare there desired List property with appropriate getter and setter methods.<\/p>\n<pre class=\" brush:java\">public class FootballTeams {\r\n\r\nprivate List teamsList;\r\n\r\npublic List getTeamsList() {\r\nreturn teamsList;\r\n}\r\n\r\npublic void setTeamsList(List teamsList) {\r\nthis.teamsList = teamsList;\r\n}\r\n\r\n}<\/pre>\n<p>After I created the domain model, I should develop controller with two methods \u2013 the one for navigation on a page with checkboxes, and another for processing of the checkboxes.<\/p>\n<pre class=\" brush:java\">@Controller\r\npublic class FootballController {\r\n\r\n@RequestMapping(value=\"\/football-page\")\r\nprivate ModelAndView footballPage() {\r\nModelAndView mav = new ModelAndView(\"football-form\");\r\n\r\nList teams = new ArrayList();\r\nteams.add(\"Bavaria Munich\");\r\nteams.add(\"Borussia Dortmund\");\r\nteams.add(\"Real Madrid\");\r\nteams.add(\"Barcelona\");\r\n\r\nmav.addObject(\"teamsList\", teams);\r\nmav.addObject(\"footballTeams\", new FootballTeams());\r\n\r\nreturn mav;\r\n}\r\n\r\n@RequestMapping(value=\"\/football-result\")\r\nprivate ModelAndView processTeams(@ModelAttribute FootballTeams footballTeams) {\r\nModelAndView mav = new ModelAndView(\"football-result\");\r\nmav.addObject(\"footballTeams\", footballTeams);\t\r\nreturn mav;\r\n}\r\n\r\n}<\/pre>\n<p>Notice that in the <em>footballPage()<\/em> method I created the list of teams, and then I added it to the model. The second method doesn\u2019t contain something special, so I don\u2019t want consider it. Now let\u2019s examine snippets of the views:<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" alt=\"\" src=\"http:\/\/fruzenshtein.com\/wp-content\/uploads\/2013\/05\/spring-mvc-checkboxes-list.jpg\" width=\"194\" height=\"249\" \/><\/p>\n<pre class=\" brush:html\">...\r\n&lt;h1&gt;Football page&lt;\/h1&gt;\r\n&lt;form:form method=\"POST\" commandname=\"footballTeams\" action=\"football-result.html\"&gt;\r\n&lt;table&gt;\r\n    &lt;tbody&gt;&lt;tr&gt;\r\n    &lt;td&gt;\r\n&lt;ul&gt;\r\n&lt;form:checkboxes element=\"li\" path=\"teamsList\" items=\"${teamsList}\"&gt;\r\n&lt;\/form:checkboxes&gt;&lt;\/ul&gt;\r\n    &lt;\/td&gt;\r\n    &lt;\/tr&gt;\r\n    &lt;tr&gt;\r\n        &lt;td&gt;\r\n            &lt;input value=\"Submit\" type=\"submit\"&gt;\r\n        &lt;\/td&gt;\r\n    &lt;\/tr&gt;\r\n&lt;\/tbody&gt;&lt;\/table&gt;\r\n&lt;\/form:form&gt;\r\n...\r\n<\/pre>\n<p>Here I need to make a pause and explain what\u2019s going on. In the \u2018checkboxes\u2019 tag I specified the <em>path<\/em> attribute. The value of the attribute corresponds to the appropriate field of the FootballTeams class. The <em>items<\/em> attribute contains value of the list, which I generated in the controller\u2019s <em>footballPage()<\/em> method.<br \/>\nThe last one view:<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" alt=\"\" src=\"http:\/\/fruzenshtein.com\/wp-content\/uploads\/2013\/05\/spring-mvc-checkboxes-list-result.jpg\" width=\"278\" height=\"136\" \/><\/p>\n<pre class=\" brush:html\">...\r\n&lt;h1&gt;Football result page&lt;\/h1&gt;\r\nSelected teams:\r\n&lt;br&gt;\r\n&lt;c:foreach var=\"team\" items=\"${footballTeams.teamsList}\"&gt;\r\n${team}&lt;br&gt;\r\n&lt;\/c:foreach&gt;\r\n...\r\n<\/pre>\n<p>Here I just go through items which were selected on the previous page. Pay your attention that labels and values for the checkboxes were the same, as I specified in the list. If you want to have the different value and label for one checkbox, you have to use java.util.Map.<\/p>\n<h2>Map and \u2018checkboxes\u2019 tag<\/h2>\n<p>The second example will be with the Map. So as you suppose I\u2019m going to show how to use different values and labels for same checkboxes. The structure of the section will be the same as in the previous one, so let\u2019s start!<\/p>\n<p>Domain model:<\/p>\n<pre class=\" brush:java\">public class Tourism {\r\n\r\nprivate List countries;\r\n\r\npublic List getCountries() {\r\nreturn countries;\r\n}\r\n\r\npublic void setCountries(List countries) {\r\nthis.countries = countries;\r\n}\r\n\r\n}<\/pre>\n<p>Don\u2019t panic, that you didn\u2019t see any Map field in the class, you will recognize this later.<\/p>\n<pre class=\" brush:java\">@Controller\r\npublic class TourismController {\r\n\r\n@RequestMapping(value=\"\/tourism-page\")\r\nprivate ModelAndView tourismPage() {\r\nModelAndView mav = new ModelAndView(\"tourism-form\");\r\n\r\nMap countries = new HashMap();\r\ncountries.put(\"UKR\", \"Ukraine\");\r\ncountries.put(\"ENG\", \"England\");\r\ncountries.put(\"USA\", \"United States\");\r\n\r\nmav.addObject(\"countriesMap\", countries);\r\nmav.addObject(\"tourism\", new Tourism());\r\n\r\nreturn mav;\r\n}\r\n\r\n@RequestMapping(value=\"\/tourism-result\")\r\nprivate ModelAndView processTourism(@ModelAttribute Tourism tourism) {\r\nModelAndView mav = new ModelAndView(\"tourism-result\");\r\nmav.addObject(\"tourism\", tourism);\t\r\nreturn mav;\r\n}\r\n\r\n}<\/pre>\n<p>Here in the <em>tourismPage()<\/em> method Map appears on a scene.<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" alt=\"\" src=\"http:\/\/fruzenshtein.com\/wp-content\/uploads\/2013\/05\/spring-mvc-checkboxes-map.jpg\" width=\"195\" height=\"230\" \/><\/p>\n<pre class=\" brush:html\">...\r\n&lt;h1&gt;Tourism page&lt;\/h1&gt;\r\n&lt;form:form method=\"POST\" commandname=\"tourism\" action=\"tourism-result.html\"&gt;\r\n&lt;table&gt;\r\n    &lt;tbody&gt;&lt;tr&gt;\r\n    &lt;td&gt;\r\n&lt;ul&gt;\r\n&lt;form:checkboxes element=\"li\" path=\"countries\" items=\"${countriesMap}\"&gt;\r\n&lt;\/form:checkboxes&gt;&lt;\/ul&gt;\r\n    &lt;\/td&gt;\r\n    &lt;\/tr&gt;\r\n    &lt;tr&gt;\r\n        &lt;td&gt;\r\n            &lt;input value=\"Submit\" type=\"submit\"&gt;\r\n        &lt;\/td&gt;\r\n    &lt;\/tr&gt;\r\n&lt;\/tbody&gt;&lt;\/table&gt;\r\n&lt;\/form:form&gt;\r\n...\r\n<\/pre>\n<p>Map\u2019s keys will be used as values of checkboxes, and Map\u2019s values will be used as labels of checkboxes.<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" alt=\"\" src=\"http:\/\/fruzenshtein.com\/wp-content\/uploads\/2013\/05\/spring-mvc-checkboxes-map-result.jpg\" width=\"281\" height=\"120\" \/><\/p>\n<pre class=\" brush:html\">...\r\n&lt;h1&gt;Tourism result page&lt;\/h1&gt;\r\nSelected countries:\r\n&lt;br&gt;\r\n&lt;c:foreach var=\"country\" items=\"${tourism.countries}\"&gt;\r\n${country}&lt;br&gt;\r\n&lt;\/c:foreach&gt;\r\n...\r\n<\/pre>\n<p>It\u2019s time to explain, why there is no Map field in the Tourism class. As you see, just Map\u2019s keys are displayed on the result page. So key-value pairs are not passed to the model.<\/p>\n<h2>Summary<\/h2>\n<p>From the tutorial you can make a conclusion when \u2018checkboxes\u2019 tag is better to use. Spring MVC is very flexible framework, and it provides certain tools for the certain tasks. Use Map or List depending on aims. The source code you can see on the <a href=\"https:\/\/github.com\/Fruzenshtein\/EduSprMvc\" target=\"_blank\">GitHub<\/a>.<br \/>\n&nbsp;<\/p>\n<div style=\"border: 1px solid #D8D8D8; background: #FAFAFA; width: 100%; padding-left: 5px;\"><b><i>Reference: <\/i><\/b><a href=\"http:\/\/fruzenshtein.com\/spring-mvc-form-checkboxes\/\">Spring MVC: form handling vol. 3 \u2013 checkboxes processing<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\">JCG partner<\/a> Alexey Zvolinskiy at the <a href=\"http:\/\/fruzenshtein.com\/\">Fruzenshtein&#8217;s notes<\/a> blog.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>I have already published the post about processing of \u2018checkbox\u2019 tag using Spring MVC tag library. Now I want to develop this theme and proceed with the \u2018checkboxes\u2019 tag. It\u2019s not much harder, but in some cases you\u2019d better to use it. In this article I will provide examples of Spring \u2018checkboxes\u2019 tag in conjunction &hellip;<\/p>\n","protected":false},"author":374,"featured_media":240,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[30,150],"class_list":["post-12756","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-spring","tag-spring-mvc"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Spring MVC: form handling vol. 3 \u2013 checkboxes processing<\/title>\n<meta name=\"description\" content=\"I have already published the post about processing of \u2018checkbox\u2019 tag using Spring MVC tag library. Now I want to develop this theme and proceed with the\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-form-handling-vol-3-checkboxes-processing.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring MVC: form handling vol. 3 \u2013 checkboxes processing\" \/>\n<meta property=\"og:description\" content=\"I have already published the post about processing of \u2018checkbox\u2019 tag using Spring MVC tag library. Now I want to develop this theme and proceed with the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-form-handling-vol-3-checkboxes-processing.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2013-05-13T10:00:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Alexey Zvolinskiy\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alexey Zvolinskiy\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-form-handling-vol-3-checkboxes-processing.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-form-handling-vol-3-checkboxes-processing.html\"},\"author\":{\"name\":\"Alexey Zvolinskiy\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/ac87395bf8afb0ae3515feb6a0f36d02\"},\"headline\":\"Spring MVC: form handling vol. 3 \u2013 checkboxes processing\",\"datePublished\":\"2013-05-13T10:00:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-form-handling-vol-3-checkboxes-processing.html\"},\"wordCount\":579,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-form-handling-vol-3-checkboxes-processing.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"keywords\":[\"Spring\",\"Spring MVC\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-form-handling-vol-3-checkboxes-processing.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-form-handling-vol-3-checkboxes-processing.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-form-handling-vol-3-checkboxes-processing.html\",\"name\":\"Spring MVC: form handling vol. 3 \u2013 checkboxes processing\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-form-handling-vol-3-checkboxes-processing.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-form-handling-vol-3-checkboxes-processing.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"datePublished\":\"2013-05-13T10:00:34+00:00\",\"description\":\"I have already published the post about processing of \u2018checkbox\u2019 tag using Spring MVC tag library. Now I want to develop this theme and proceed with the\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-form-handling-vol-3-checkboxes-processing.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-form-handling-vol-3-checkboxes-processing.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-form-handling-vol-3-checkboxes-processing.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"spring-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/05\\\/spring-mvc-form-handling-vol-3-checkboxes-processing.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Spring MVC: form handling vol. 3 \u2013 checkboxes processing\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/ac87395bf8afb0ae3515feb6a0f36d02\",\"name\":\"Alexey Zvolinskiy\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/082c897ff3a223afa16dedb5c6638b8b7caef162b241379e9c755b70aed186f5?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/082c897ff3a223afa16dedb5c6638b8b7caef162b241379e9c755b70aed186f5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/082c897ff3a223afa16dedb5c6638b8b7caef162b241379e9c755b70aed186f5?s=96&d=mm&r=g\",\"caption\":\"Alexey Zvolinskiy\"},\"description\":\"Alexey is a test developer with solid experience in automation of web-applications using Java, TestNG and Selenium. He is so much into QA that even after work he provides training courses for junior QA engineers.\",\"sameAs\":[\"http:\\\/\\\/fruzenshtein.com\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/alexey-zvolinskiy\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Spring MVC: form handling vol. 3 \u2013 checkboxes processing","description":"I have already published the post about processing of \u2018checkbox\u2019 tag using Spring MVC tag library. Now I want to develop this theme and proceed with the","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-form-handling-vol-3-checkboxes-processing.html","og_locale":"en_US","og_type":"article","og_title":"Spring MVC: form handling vol. 3 \u2013 checkboxes processing","og_description":"I have already published the post about processing of \u2018checkbox\u2019 tag using Spring MVC tag library. Now I want to develop this theme and proceed with the","og_url":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-form-handling-vol-3-checkboxes-processing.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2013-05-13T10:00:34+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","type":"image\/jpeg"}],"author":"Alexey Zvolinskiy","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Alexey Zvolinskiy","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-form-handling-vol-3-checkboxes-processing.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-form-handling-vol-3-checkboxes-processing.html"},"author":{"name":"Alexey Zvolinskiy","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/ac87395bf8afb0ae3515feb6a0f36d02"},"headline":"Spring MVC: form handling vol. 3 \u2013 checkboxes processing","datePublished":"2013-05-13T10:00:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-form-handling-vol-3-checkboxes-processing.html"},"wordCount":579,"commentCount":4,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-form-handling-vol-3-checkboxes-processing.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","keywords":["Spring","Spring MVC"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-form-handling-vol-3-checkboxes-processing.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-form-handling-vol-3-checkboxes-processing.html","url":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-form-handling-vol-3-checkboxes-processing.html","name":"Spring MVC: form handling vol. 3 \u2013 checkboxes processing","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-form-handling-vol-3-checkboxes-processing.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-form-handling-vol-3-checkboxes-processing.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","datePublished":"2013-05-13T10:00:34+00:00","description":"I have already published the post about processing of \u2018checkbox\u2019 tag using Spring MVC tag library. Now I want to develop this theme and proceed with the","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-form-handling-vol-3-checkboxes-processing.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-form-handling-vol-3-checkboxes-processing.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-form-handling-vol-3-checkboxes-processing.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","width":150,"height":150,"caption":"spring-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2013\/05\/spring-mvc-form-handling-vol-3-checkboxes-processing.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Spring MVC: form handling vol. 3 \u2013 checkboxes processing"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/ac87395bf8afb0ae3515feb6a0f36d02","name":"Alexey Zvolinskiy","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/082c897ff3a223afa16dedb5c6638b8b7caef162b241379e9c755b70aed186f5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/082c897ff3a223afa16dedb5c6638b8b7caef162b241379e9c755b70aed186f5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/082c897ff3a223afa16dedb5c6638b8b7caef162b241379e9c755b70aed186f5?s=96&d=mm&r=g","caption":"Alexey Zvolinskiy"},"description":"Alexey is a test developer with solid experience in automation of web-applications using Java, TestNG and Selenium. He is so much into QA that even after work he provides training courses for junior QA engineers.","sameAs":["http:\/\/fruzenshtein.com\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/alexey-zvolinskiy"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/12756","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/374"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=12756"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/12756\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/240"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=12756"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=12756"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=12756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}