Hi,
I've got my code working (in a Spring form validator) and when I get the default error message, I'm seeing
TOO_SHORT:{minimumLength=8, maximumLength=16}
This is my code
List<Rule> ruleList = new ArrayList<Rule>();
LengthRule lengthRule = new LengthRule(8, 16);
ruleList.add(lengthRule);
PasswordValidator validator = new PasswordValidator(ruleList);
PasswordData passwordData = new PasswordData(new Password(changePasswordForm.getPassword()));
RuleResult result = validator.validate(passwordData);
if (!result.isValid())
errors.rejectValue("password", "Password.invalid", validator.getMessages(result).toArray(), "");
Where the errors.rejectVaue is a Spring output with just
I thought it would look like
Password must be at least %1$s characters in length.
Thanks,
Jim