Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-1787

Token session interceptor faiing with redirect-action

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.6
    • 2.0.7, 2.1.0
    • Core Interceptors
    • None
    • Patch

    Description

      This is a patch from Webwork.

      Original Issue: http://jira.opensymphony.com/browse/WW-1404

      Index: /projects/backup/webwork-trunk/src/java/com/opensymphony/webwork/interceptor/TokenSessionStoreInterceptor.java
      ===================================================================
      — /projects/backup/webwork-trunk/src/java/com/opensymphony/webwork/interceptor/TokenSessionStoreInterceptor.java (revision 2855)
      +++ /projects/backup/webwork-trunk/src/java/com/opensymphony/webwork/interceptor/TokenSessionStoreInterceptor.java (working copy)
      @@ -4,6 +4,11 @@
      */
      package com.opensymphony.webwork.interceptor;

      +import java.util.Map;
      +
      +import javax.servlet.http.HttpServletRequest;
      +import javax.servlet.http.HttpServletResponse;
      +
      import com.opensymphony.webwork.ServletActionContext;
      import com.opensymphony.webwork.util.InvocationSessionStore;
      import com.opensymphony.webwork.util.TokenHelper;
      @@ -12,9 +17,6 @@
      import com.opensymphony.xwork.Result;
      import com.opensymphony.xwork.util.OgnlValueStack;

      -import javax.servlet.http.HttpServletRequest;
      -import java.util.Map;
      -

      /**

      • <!-- START SNIPPET: description -->
        @@ -94,6 +96,7 @@
        ActionContext ac = invocation.getInvocationContext();

      HttpServletRequest request = (HttpServletRequest) ac.get(ServletActionContext.HTTP_REQUEST);
      + HttpServletResponse response = (HttpServletResponse) ac.get(ServletActionContext.HTTP_RESPONSE);
      String tokenName = TokenHelper.getTokenName();
      String token = TokenHelper.getToken(tokenName);

      @@ -110,8 +113,10 @@
      Map context = stack.getContext();
      request.setAttribute(ServletActionContext.WEBWORK_VALUESTACK_KEY, stack);

      + ActionContext savedContext = savedInvocation.getInvocationContext();
      + savedContext.getContextMap().put(ServletActionContext.HTTP_REQUEST, request);
      + savedContext.getContextMap().put(ServletActionContext.HTTP_RESPONSE, response);
      Result result = savedInvocation.getResult();
      -
      if ((result != null) && (savedInvocation.getProxy().getExecuteResult())) {
      synchronized (context) {
      result.execute(savedInvocation);

      Attachments

        Issue Links

          Activity

            People

              husted Ted Husted
              tschneider Thomas Schneider
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: