public String viewChangePassword(HttpServletRequest request, Model model) {
return getChangePasswordView();
}
public String processChangePassword(HttpServletRequest request, Model model, ChangePasswordForm form, BindingResult result, RedirectAttributes redirectAttributes) throws ServiceException {
PasswordChange passwordChange = new PasswordChange(CustomerState.getCustomer().getUsername());
passwordChange.setCurrentPassword(form.getCurrentPassword());
passwordChange.setNewPassword(form.getNewPassword());
passwordChange.setNewPasswordConfirm(form.getNewPasswordConfirm());
changePasswordValidator.validate(passwordChange, result);
if (result.hasErrors()) {
return getChangePasswordView();
}
customerService.changePassword(passwordChange);