I have an <form:input type="text" /> element that can take several values, each delimited by a semicolon. For example, it can take a value such as Mike;Jack;Bob.
How can I bind/pass this type of value for an <input> to a Collection<String> in Spring 3 MVC?
You can register a property editor:
@InitBinder
public void initBinder(WebDataBinder binder) {
binder.registerCustomEditor(Collection.class,
new DelimitedCollectionStringEditor());
}
where the editor must extend PropertyEditorSupport
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With