0

在我的情况下。在这个方法中

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 是 NULL 如何得到我的预期结果

4

1 回答 1

1

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

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

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

于 2020-04-14T14:44:48.950 回答