Skip to content

Instantly share code, notes, and snippets.

@leonardinius
Created December 19, 2013 07:06
Show Gist options
  • Save leonardinius/8035458 to your computer and use it in GitHub Desktop.
Save leonardinius/8035458 to your computer and use it in GitHub Desktop.
public static class PasswordChange {
@MinLength(5)
@Required
public String password;
@MinLength(5)
@Required
public String repeatPassword;
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getRepeatPassword() {
return repeatPassword;
}
public void setRepeatPassword(String repeatPassword) {
this.repeatPassword = repeatPassword;
}
public String validate() {
if (password == null || !password.equals(repeatPassword)) {
return Messages.get("auth.change_password.error.passwords_not_same");
}
return null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment