public Result changePassword(Request request) { String password = request.get("password"); String newPwd = request.get("newPwd"); String confirm = request.get("confirm"); String userId = CapSecurityContext.getUserId(); if (passwordService.validatePassword(userId, password)) { passwordService.checkPasswordRule(userId, newPwd, confirm, false); passwordService.changeUserPassword(userId, newPwd); } else { throw new CapMessageException(CapAppContext.getMessage("error.009"), getClass()); } return new AjaxFormResult(); }