@RequestMapping(value = "/addGroup", method = RequestMethod.POST)
 public ModelAndView addGroupPost(@RequestParameter("name") final String name) {
   try {
     this.service.createGroup(name);
   } catch (final Exception e) {
     return CommonController.createError(
         "Create deploy group", "Failed to create deploy group", e);
   }
   return new ModelAndView("redirect:/deploy/auth/group");
 }
 @RequestMapping(value = "/group/{groupId}/createKey", method = RequestMethod.POST)
 public ModelAndView createDeployKeyPost(
     @PathVariable("groupId") final String groupId,
     @RequestParameter(value = "name", required = false) final String name) {
   try {
     this.service.createDeployKey(groupId, name);
     return new ModelAndView(
         "redirect:/deploy/auth/group/" + urlPathSegmentEscaper().escape(groupId) + "/view");
   } catch (final Exception e) {
     return CommonController.createError("Create deploy key", "Failed to create deploy key", e);
   }
 }
  @RequestMapping(value = "/key/{keyId}/edit")
  public ModelAndView editKey(@PathVariable("keyId") final String keyId) {
    final DeployKey key = this.service.getDeployKey(keyId);

    if (key == null) {
      return CommonController.createNotFound("Deploy Key", keyId);
    }

    final Map<String, Object> model = new HashMap<>();

    model.put("command", DeployKeyBean.fromKey(key));

    return new ModelAndView("editKey", model);
  }
  @RequestMapping(value = "/group/{groupId}/createKey")
  public ModelAndView createDeployKey(@PathVariable("groupId") final String groupId) {
    final DeployGroup group = this.service.getGroup(groupId);

    if (group == null) {
      return CommonController.createNotFound("Deploy Group", groupId);
    }

    final Map<String, Object> model = new HashMap<>();

    model.put("group", group);
    addBreadcrumbs("Create key", groupId, model);

    return new ModelAndView("createDeployKey", model);
  }