英文:
login and checkout user redirecting to home page how to redirect to cart page in sap hybris
问题
在我的情况下,在这个方法中
```java
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,如何获取我期望的结果
<details>
<summary>英文:</summary>
here in my case. in this method
```java
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);
i am getting savedRequest is NULL how to get my expected result
答案1
得分: 1
在CheckoutLoginController.java
中,
添加private static final String REFERER = "referer";
在doCheckoutLogin
方法中,添加request.getSession().setAttribute("redirectTargetUrl", request.getHeader(REFERER));
之后,请求将被添加到会话中。
英文:
In CheckoutLoginController.java
,
add private static final String REFERER = "referer";
In doCheckoutLogin
method, add request.getSession().setAttribute("redirectTargetUrl", request.getHeader(REFERER));
After this, the request will be added to the session.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论