Now I really need help. I tried parsing the request in the onBind as Fabien mentionned but Spring trows me
Failed to convert property value of type [java.lang.String] to required type [java.util.List] for property models
with this jsp:
Code:
<spring:bind path="reoDataModel.models">
<c:forEach var="model" items="${models}">
<INPUT class="checkbox" type="checkbox"
value='<c:out value="${model.programId}" />'
name='<c:out value="${status.expression}" />'
<c:forEach var="m" items="${reoDataModel.models}">
<c:if test="${m.programId==model.programId}">CHECKED</c:if>
</c:forEach> >
<c:out value="${model.modelName}" />
<br />
</c:forEach>
</spring:bind>
And this is the code in my form controller:
Code:
protected void onBind(HttpServletRequest request, Object command, BindException errors) {
ReoDataModel reo = (ReoDataModel) command;
//parse checked models from the request
List models=new LinkedList();
String[] reqModels = request.getParameterValues("models");
if (reqModels != null) {
for (int i = 0; i < reqModels.length; i++) {
models.add(Model.findById(reqModels[i]));
}
}
reo.setModels(models);
}
Do I have to remove the bind from the JSP? How can spring know I've actually handled this property of the command and how can I tell Spring to ignore it?
Any hint would help!
Uze