In this example, I don't understand what the BindingResult
is for and what it means to say if (binding.hasErrors())
below.
@RequestMapping(value = "/test", method = RequestMethod.POST)
public final String submit(@ModelAttribute(TEST) @Valid final Test test, final BindingResult binding,
final HttpServletRequest request, final ModelMap modelMap)
{
if (binding.hasErrors())
{
return "test";
}