/** Saves form data. */ @RequestMapping(value = "/save", method = RequestMethod.POST) public String save( @ModelAttribute("owner") Owner owner, BindingResult bindingResult, Model model) { new OwnerValidator().validate(owner, bindingResult); if (bindingResult.hasErrors()) { model.addAttribute( "allErrors", BindingResultUtils.getErrorMessages(bindingResult, messageSource)); return "owner/EditForm"; } clinic.storeOwner(owner); return "redirect:/owner/" + owner.getId(); }