以我为例。在这个方法中
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);
我得到了savedRequest is NULL如何获得我的预期结果
最佳答案
在CheckoutLoginController.java
中,
添加 private static Final String REFERER = "referer";
在doCheckoutLogin
方法中,添加request.getSession().setAttribute("redirectTargetUrl", request.getHeader(REFERER));
此后,请求将被添加到 session 中。
关于java - 登录和结帐用户重定向到主页如何重定向到 sap hybris 中的购物车页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61056675/