use of org.springframework.web.context.request.ServletWebRequest in project BroadleafCommerce by BroadleafCommerce.
the class TranslationFilter method doFilterUnlessIgnored.
@Override
public void doFilterUnlessIgnored(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
try {
translationRequestProcessor.process(new ServletWebRequest((HttpServletRequest) request, (HttpServletResponse) response));
filterChain.doFilter(request, response);
} finally {
translationRequestProcessor.postProcess(new ServletWebRequest((HttpServletRequest) request, (HttpServletResponse) response));
}
}
use of org.springframework.web.context.request.ServletWebRequest in project BroadleafCommerce by BroadleafCommerce.
the class BroadleafLoginController method processForgotPassword.
/**
* Looks up the passed in username and sends an email to the address on file with a
* reset password token.
*
* Returns error codes for invalid username.
*
* @param username
* @param request
* @param model
* @return the return view
*/
public String processForgotPassword(String username, HttpServletRequest request, Model model) {
GenericResponse errorResponse = customerService.sendForgotPasswordNotification(username, getResetPasswordUrl(request));
if (errorResponse.getHasErrors()) {
String errorCode = errorResponse.getErrorCodesList().get(0);
model.addAttribute("errorCode", errorCode);
return getForgotPasswordView();
} else {
if (BLCRequestUtils.isOKtoUseSession(new ServletWebRequest(request))) {
request.getSession(true).setAttribute(CHANGE_PASSWORD_USERNAME_REQUEST_ATTR, username);
}
return getForgotPasswordSuccessView();
}
}
use of org.springframework.web.context.request.ServletWebRequest in project BroadleafCommerce by BroadleafCommerce.
the class BroadleafLoginController method processForcedPasswordChange.
public String processForcedPasswordChange(String username, HttpServletRequest request, Model model) {
final String resetPasswordUrl = getResetPasswordUrl(request);
final GenericResponse errorResponse = customerService.sendForcedPasswordChangeNotification(username, resetPasswordUrl);
if (errorResponse.getHasErrors()) {
final String errorCode = errorResponse.getErrorCodesList().get(0);
model.addAttribute("errorCode", errorCode);
return getForcedPasswordChangeView();
} else {
if (BLCRequestUtils.isOKtoUseSession(new ServletWebRequest(request))) {
request.getSession(true).setAttribute(CHANGE_PASSWORD_USERNAME_REQUEST_ATTR, username);
}
return getForcedPasswordChangeSuccessView();
}
}
use of org.springframework.web.context.request.ServletWebRequest in project BroadleafCommerce by BroadleafCommerce.
the class BroadleafLoginController method initResetPasswordForm.
/**
* Initializes the reset password by ensuring that the passed in token URL
* parameter initializes the hidden form field.
*
* Also, if the reset password request is in the same session as the
* forgotPassword request, the username will auto-populate
*
* @param request
* @return the return view
*/
public ResetPasswordForm initResetPasswordForm(HttpServletRequest request) {
final ResetPasswordForm resetPasswordForm = new ResetPasswordForm();
final String token = request.getParameter("token");
String username = null;
if (BLCRequestUtils.isOKtoUseSession(new ServletWebRequest(request))) {
username = (String) request.getSession(true).getAttribute(CHANGE_PASSWORD_USERNAME_REQUEST_ATTR);
}
resetPasswordForm.setToken(token);
resetPasswordForm.setUsername(username);
return resetPasswordForm;
}
use of org.springframework.web.context.request.ServletWebRequest in project BroadleafCommerce by BroadleafCommerce.
the class CookieRuleFilter method doFilterInternalUnlessIgnored.
@Override
protected void doFilterInternalUnlessIgnored(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain) throws ServletException, IOException {
ServletWebRequest request = new ServletWebRequest(httpServletRequest, httpServletResponse);
try {
processor.process(request);
filterChain.doFilter(httpServletRequest, httpServletResponse);
} finally {
processor.postProcess(request);
}
}
Aggregations