Object onSuccessFromForm() { Users users = new UsersImpl(); users.updateUser(user, newPassword); alertManager.alert(Duration.TRANSIENT, Severity.SUCCESS, "Password changed"); return indexPage; }
void onValidateFromForm() { Users users = new UsersImpl(); try { users.login(user, oldPassword); } catch (Exception e) { form.recordError(oldPasswordField, "Old password is not OK"); } logger.debug("Password1: *{}*, passwod2: *{}*", newPassword, verifyNewPassword); if (!newPassword.equals(verifyNewPassword)) { form.recordError(verifyNewPasswordField, "Passwords do not match"); } }