Controller

Notice that we need to use @ModelAttribute to make sure an instance of MyUser is always available in the model. In the validateForm(), we need to use @ModelAttribute to move the content of the form to the MyUser project.

Hi, I have a big question. Is it possible send a list or array of objects for to be validated with “hasErros”? By Example, I have a object called “calification”, this object contains 2 attributes: “cal” and “decimal”. In my JSP I send a list of alumns, for each of then I want to send the object “calification”, then I want to validate all objects with BindingResult.hasErrors, is that possible?

Newsletter

Join them now to gain exclusive access to the latest news in the Java world, as well as insights about Android, Scala, Groovy and other related technologies.

Email address:

Join Us

With 1,043,221 monthly unique visitors and over 500 authors we are placed among the top Java related sites around. Constantly being on the lookout for partners; we encourage you to join us. So If you have a blog with unique and interesting content then you should check out our JCG partners program. You can also be a guest writer for Java Code Geeks and hone your writing skills!