I'm building a Spring MVC app with Spring 3.0.3. I have data binding of my form working just fine, but one of the form fields is a list of items. Hypothetically speaking, my form object looks like this:
public class MyForm {
private String name;
private List<String> items;
public String getName() {
return name;
}
public void setName( String value ) {
name = value;
}
public List<String> getItems() {
return items;
}
public void setItems( List<String> value ) {
items = value;
}
}
Lets say the form is being handled through a GET with a query string that looks like the following:
"/url?name=GroupName&items=Item-1&items=Item-2&items=Item-3"
As of now, the items property of my MyForm
object binds just fine with a list of String values. What I'm curious about is if I can still achieve data binding if I were to change the items list type to something more specific, such as:
private List<MyListItem> items;