struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Schneider (JIRA)" <j...@apache.org>
Subject [jira] Created: (WW-1787) Token session interceptor faiing with redirect-action
Date Sun, 04 Mar 2007 01:58:16 GMT
Token session interceptor faiing with redirect-action
-----------------------------------------------------

                 Key: WW-1787
                 URL: https://issues.apache.org/struts/browse/WW-1787
             Project: Struts 2
          Issue Type: Bug
          Components: Interceptors
    Affects Versions: 2.0.6
            Reporter: Tom Schneider
         Assigned To: Tom Schneider
            Priority: Minor
             Fix For: 2.0.7, 2.1.0


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);


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message