errors.add(Globals.ERROR_KEY, new ActionMessage("setPassword.error.newAndConfirmPasswordsDontMatch"));
} else {
// Check that the password matches the current policy, if
// not then request a new one
try {
String pattern = Property.getProperty(new RealmKey("security.password.pattern", getUser().getRealm().getResourceId()));
Pattern p = Pattern.compile(pattern);
if (!p.matcher(newPassword).matches()) {
errors.add(Globals.ERROR_KEY, new ActionMessage("setPassword.error.doesNotMatchPolicy"));
}
} catch (Exception e) {