Spring MVC: form handling vol. 5 – select, option, options tags

Drop-down lists are the one of the most frequent elements in web forms. In HTML you can create such control using appropriate tags: < form:select > – parent tag of drop-down list and < form:option > – child tag of < form:select > tag. Spring MVC tag library has its own solution for the drop-down lists. In this post I will write about < form:select >, < form:option >, and < form:options > tags.spring-mvc-drop-down

In the previous articles about form handling using Spring MVC I have made an overview of cases when we need to bind text field, check-boxes or radio buttons with a java object. Almost all steps will be repeated for the select drop-down list element. Further I will examine three situations with drop-down lists in context of binding it with java object using Spring MVC tag library. The first case will be about form:select tag with values based on java.util.Map, the second example will be about usage of form:select tag in conjunction with form:option tags, the third example will be about usage of form:select tag in conjunction with form:options tag.


Source : http://www.javacodegeeks.com/2013/07/spring-mvc-form-handling-vol-5-select-option-options-tags.html

Back to Top