struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hus...@apache.org
Subject svn commit: r517433 - /struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/interceptor/TokenSessionStoreInterceptor.java
Date Mon, 12 Mar 2007 22:34:58 GMT
Author: husted
Date: Mon Mar 12 15:34:58 2007
New Revision: 517433

URL: http://svn.apache.org/viewvc?view=rev&rev=517433
Log:
WW-1787 "Token session interceptor faiing with redirect-action" Apply patch based on WebWork
#1404.

Modified:
    struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/interceptor/TokenSessionStoreInterceptor.java

Modified: struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/interceptor/TokenSessionStoreInterceptor.java
URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/interceptor/TokenSessionStoreInterceptor.java?view=diff&rev=517433&r1=517432&r2=517433
==============================================================================
--- struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/interceptor/TokenSessionStoreInterceptor.java
(original)
+++ struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/interceptor/TokenSessionStoreInterceptor.java
Mon Mar 12 15:34:58 2007
@@ -23,6 +23,7 @@
 import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 
 import org.apache.struts2.ServletActionContext;
 import org.apache.struts2.util.InvocationSessionStore;
@@ -110,6 +111,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);
 
@@ -126,6 +128,9 @@
                 Map context = stack.getContext();
                 request.setAttribute(ServletActionContext.STRUTS_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()))
{



Mime
View raw message