【发布时间】:2011-07-09 17:36:11
【问题描述】:
我正在为我的一个应用程序使用 spring mvc portlet。我在将动态填充的列表框与 Controller 中的 List 集合绑定时遇到问题。
Conference.java:
public class Conference {
private List<Patient> scheduledPatients;
//getter/setter for scheduledPatients
}
saveParticipants.jsp
<form:select path="scheduledParticipants" items="${scheduledParticipants}" itemLabel="name" itemValue="name" />
scheduledParticipants 列表数据填充了从另一个列表框中选择的数据并移动到 scheduleParticipants 列表框。
在提交操作请求时,我无法在控制器操作映射中绑定新填充的 scheduleParticipants。 ModelAttribute 是 Conference pojo。
我们使用 InitBinder 将数据绑定到 scheduleParticipants。 我仍然无法在控制器上获取选定的参与者数据。
有谁知道如何做到这一点?
【问题讨论】:
标签: spring select binding portlet