that can take several values, each...">

Binding delimited strings in a text field in Collection <String>

I have an element <form:input type="text" />that can take several values, each of which is limited to a semicolon. For example, it can take a value, for example Mike;Jack;Bob.

How to bind / pass this value type to <input>in Collection<String>in Spring 3 MVC?

+3
source share
1 answer

You can register the property editor:

@InitBinder
public void initBinder(WebDataBinder binder) {
    binder.registerCustomEditor(Collection.class, 
          new DelimitedCollectionStringEditor());
}

where the editor should expand PropertyEditorSupport

+3
source

All Articles