@RequestMapping(method = RequestMethod.PUT, produces = "text/html") public String update( @Valid Team team, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) { if (bindingResult.hasErrors()) { populateEditForm(uiModel, team); return "teams/update"; } uiModel.asMap().clear(); team.merge(); return "redirect:/teams/" + encodeUrlPathSegment(team.getId().toString(), httpServletRequest); }