Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error MVC org.springframework.validation.BeanPropertyBindingResult: 1 errors with array

Hi I try pass an array in a bean from jsp to java.

@ModelAttribute("areasActividadAdminBean")AreasActividadAdminBean areasActividadAdminBean

Agrupacion[] listaAgrupaciones = x;

model.addAttribute("areasActividadAdminBean",areasActividadAdminBean);

In JSP i have this:

<form:form commandName="areasActividadAdminBean" .....>

<form:hidden path="listaAgrupaciones"/>

<input type="submit" value="Button"/>

But I get this error:

org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 1 errors
Field error in object 'areasActividadAdminBean' on field 'listaAgrupaciones': rejected value 
like image 597
quitos Avatar asked Mar 22 '13 09:03

quitos


1 Answers

Make sure the BindingResult method parameter follows the Object that you are binding to. Example

public String add(@Valid DomainObject domainObj, BindingResult result, ModelMap model) {
like image 188
noi.m Avatar answered Nov 13 '22 09:11

noi.m