@RequestMapping(value = "/group/{groupId}/edit", method = RequestMethod.POST) public ModelAndView editGroupPost( @PathVariable("groupId") final String groupId, @Valid @FormData("command") final DeployGroupBean group, final BindingResult result) { final Map<String, Object> model = new HashMap<>(1); if (!result.hasErrors()) { this.service.updateGroup(groupId, group.getName()); } model.put("command", group); addBreadcrumbs("Edit", groupId, model); return new ModelAndView("editGroup", model); }
@RequestMapping(value = "/key/{keyId}/edit", method = RequestMethod.POST) public ModelAndView editKeyPost( @PathVariable("keyId") final String keyId, @Valid @FormData("command") final DeployKeyBean key, final BindingResult result) { if (!result.hasErrors()) { final DeployKey dk = this.service.updateDeployKey(keyId, key.getName()); if (dk != null && dk.getGroup().getId() != null) { return new ModelAndView( "redirect:/deploy/auth/group/" + urlPathSegmentEscaper().escape(dk.getGroup().getId()) + "/view"); } } return new ModelAndView("editKey", Collections.singletonMap("command", key)); }