以我为例。用这种方法
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);
我正在获取saveRequest为NULL如何获得我的预期结果
答案 0 :(得分:1)
在CheckoutLoginController.java
中,
添加private static final String REFERER = "referer";
在doCheckoutLogin
方法中,添加request.getSession().setAttribute("redirectTargetUrl", request.getHeader(REFERER));
此后,请求将添加到会话中。