Professional Documents
Culture Documents
com/
spring-mvc
In Spring MVC If you want to create a page with multi-select box , here are some tricks.
//setter-getter
//Foo class
//setter-getter
<form:form commandName="fooCommand">
<div>
</label>
</c:forEach>
</form:select>
</div>
</form:form>
Most probably you won’t have any problem displaying the page. However things get nasty when you try to
In order to solve this problem you have to use CustomCollectionEditor and you need to register this editor just
@Override
Exception {
//do whatever
/* "foos" is the name of the property that we want to register a custom editor to
* you can set property name null and it means you want to register this editor for occurrences of
*/
@Override
foo.setId(fooId);
return foo;
}
});
So basically what we have done above is we force binder to use our custom editor when the property “foos” is