【发布时间】:2022-07-20 23:47:27
【问题描述】:
我需要实现此代码,但它已被弃用,我如何为 liferay 7.4 更改它?它目前在 liferay 6.2 中,我们正在迁移到 7.4,我已经考虑过了,但我不明白这个类的变化。有人可以帮帮我吗?
errorKey = "changepassword.error";
SessionErrors.add(actionRequest, e.getClass(), e);
//TODO
switch (upe.getMessage()){
case UserPasswordException.PASSWORD_ALREADY_USED:
errorKey = "that-password-has-already-been-used-please-enter-in-a-different-password";
break;
case UserPasswordException.PASSWORD_CONTAINS_TRIVIAL_WORDS:
errorKey = "that-password-uses-common-words-please-enter-in-a-password-that-is-harder-to-guess-i-e-contains-a-mix-of-numbers-and-letters";
break;
case UserPasswordException.PASSWORD_INVALID:
errorKey = "that-password-is-invalid-please-enter-in-a-different-password";
break;
case UserPasswordException.PASSWORD_LENGTH:
errorKey = "that-password-is-too-short-or-too-long-please-make-sure-your-password-is-between-x-and-512-characters";
break;
case UserPasswordException.PASSWORD_NOT_CHANGEABLE:
errorKey = "passwords-may-not-be-changed-under-the-current-password-policy";
break;
case UserPasswordException.PASSWORD_SAME_AS_CURRENT:
errorKey = "your-new-password-cannot-be-the-same-as-your-old-password-please-enter-in-a-different-password";
break;
case UserPasswordException.PASSWORD_TOO_TRIVIAL:
errorKey = "that-password-is-too-trivial";
break;
case UserPasswordException.PASSWORD_TOO_YOUNG:
errorKey = "you-cannot-change-your-password-yet-please-wait-at-least-x-before-changing-your-password-again";
break;
case UserPasswordException.PASSWORDS_DO_NOT_MATCH:
errorKey = "the-passwords-you-entered-do-not-match-each-other-please-re-enter-your-password";
break;
}
【问题讨论】:
-
你想达到什么目的?这段代码在哪里?哪个 API 已弃用?