如何绑定模型的map属性并将选定的值发送回控制器?
我可以填充下拉菜单但是在提交表单时收到错误400 - 错误的请求。
MyModel.java:
public class MyModel{
private Map<MySubModel, String> subModel = new HashMap<MySubModel, String>();
private SubModel subModelSearched;
}
SubModel.java:
public class SubModel{
public String id;
public String name;
}
JSP:
<form:form action="/mySearch" modelAttribute="myModel" method="post">
<form:select path="subModelSearched">
<form:options items="${myModel.subModel}/>
</form:select>
.....
</form:form>