登录和结帐用户重定向到主页如何重定向到 sap hybris 中的购物车页面

login and checkout user redirecting to home page how to redirect to cart page in sap hybris

以我为例。在这个方法中

onAuthenticationSuccess(final HttpServletRequest request, final HttpServletResponse response, final Authentication authentication) throws IOException, ServletException {
     final RequestCache requestCache = new HttpSessionRequestCache();
     final SavedRequest savedRequest = requestCache.getRequest(request, response);

我正在保存Request is NULL 如何获得我的预期结果

CheckoutLoginController.java中, 添加 private static final String REFERER = "referer";

doCheckoutLogin方法中,添加request.getSession().setAttribute("redirectTargetUrl", request.getHeader(REFERER));

在此之后,请求将被添加到会话中。