@RequestMapping(value = "/request/external", method = RequestMethod.POST) public String externalPasswordRequest( @Valid final ForgottenPwdForm form, final BindingResult bindingResult, final Model model, final RedirectAttributes redirectModel) throws CMSItemNotFoundException { storeCmsPageInModel(model, getContentPageForLabelOrId(null)); setUpMetaDataForContentPage(model, getContentPageForLabelOrId(null)); model.addAttribute( WebConstants.BREADCRUMBS_KEY, resourceBreadcrumbBuilder.getBreadcrumbs("forgottenPwd.title")); if (bindingResult.hasErrors()) { return ControllerConstants.Views.Pages.Password.PasswordResetRequest; } else { try { customerFacade.forgottenPassword(form.getEmail()); GlobalMessages.addFlashMessage( redirectModel, GlobalMessages.CONF_MESSAGES_HOLDER, "account.confirmation.forgotten.password.link.sent"); } catch (final UnknownIdentifierException unknownIdentifierException) { LOG.warn("Email: " + form.getEmail() + " does not exist in the database."); } return REDIRECT_PWD_REQ_CONF; } }
@RequestMapping(value = "/request", method = RequestMethod.POST) public String passwordRequest( @Valid final ForgottenPwdForm form, final BindingResult bindingResult, final Model model) throws CMSItemNotFoundException { if (bindingResult.hasErrors()) { return ControllerConstants.Views.Fragments.Password.PasswordResetRequestPopup; } else { try { customerFacade.forgottenPassword(form.getEmail()); } catch (final UnknownIdentifierException unknownIdentifierException) { LOG.warn("Email: " + form.getEmail() + " does not exist in the database."); } return ControllerConstants.Views.Fragments.Password.ForgotPasswordValidationMessage; } }