code: protected String saveAndForward(Entity<?> entity) {
      UserBean user = (UserBean) entity;
      if (entityDao.duplicate(User.class, user.getId(), "code", user.getCode())) {
        addMessage("security.error.usernameNotAvaliable", user.getCode());
        return forward(new Action(this, "edit"));
      }
      String errorMsg = "";
      // 检验用户合法性
      errorMsg = checkUser(user);
      if (Strings.isNotEmpty(errorMsg)) { return forward(new Action("edit"), errorMsg); }
      processPassword(user);
      if (!user.isPersisted()) {
        User creator = userService.get(SecurityUtils.getUsername());
        securityHelper.getUserService().createUser(creator, user);
      } else {
        securityHelper.getUserService().saveOrUpdate(user);
      }
      updateUserRole(user);
      return redirect("search", "info.save.success");
    }
docs: 保存用户信息