Author: mrdon
Date: Sat Jun 17 13:12:40 2006
New Revision: 415054

URL: http://svn.apache.org/viewvc?rev=415054&view=rev
Log:
Fixing stack in portlet mode so action always on top, removing IoC intercepter 
stack
Portlet patch provided by Nils-Helge Garli

WW-1313 WW-1286 WW-1342

Modified:
    
struts/action2/trunk/core/src/main/java/org/apache/struts/action2/portlet/dispatcher/Jsr168Dispatcher.java
    struts/action2/trunk/core/src/main/resources/struts-default.xml

Modified: 
struts/action2/trunk/core/src/main/java/org/apache/struts/action2/portlet/dispatcher/Jsr168Dispatcher.java
URL: 
http://svn.apache.org/viewvc/struts/action2/trunk/core/src/main/java/org/apache/struts/action2/portlet/dispatcher/Jsr168Dispatcher.java?rev=415054&r1=415053&r2=415054&view=diff
==============================================================================
--- 
struts/action2/trunk/core/src/main/java/org/apache/struts/action2/portlet/dispatcher/Jsr168Dispatcher.java
 (original)
+++ 
struts/action2/trunk/core/src/main/java/org/apache/struts/action2/portlet/dispatcher/Jsr168Dispatcher.java
 Sat Jun 17 13:12:40 2006
@@ -36,11 +36,8 @@
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
-import com.opensymphony.util.ClassLoaderUtil;
-import com.opensymphony.util.FileManager;
-import org.apache.struts.action2.StrutsStatics;
 import org.apache.struts.action2.StrutsConstants;
+import org.apache.struts.action2.StrutsStatics;
 import org.apache.struts.action2.config.Configuration;
 import org.apache.struts.action2.dispatcher.ApplicationMap;
 import org.apache.struts.action2.dispatcher.RequestMap;
@@ -54,12 +51,16 @@
 import org.apache.struts.action2.portlet.context.ServletContextHolderListener;
 import org.apache.struts.action2.util.AttributeMap;
 import org.apache.struts.action2.util.ObjectFactoryInitializable;
+
+import com.opensymphony.util.ClassLoaderUtil;
+import com.opensymphony.util.FileManager;
 import com.opensymphony.xwork.ActionContext;
 import com.opensymphony.xwork.ActionProxy;
 import com.opensymphony.xwork.ActionProxyFactory;
 import com.opensymphony.xwork.ObjectFactory;
 import com.opensymphony.xwork.config.ConfigurationException;
 import com.opensymphony.xwork.util.LocalizedTextUtil;
+import com.opensymphony.xwork.util.OgnlValueStack;
 
 /**
  * <!-- START SNIPPET: javadoc -->
@@ -420,8 +421,10 @@
                 ActionProxy action = (ActionProxy) request.getPortletSession()
                         .getAttribute(EVENT_ACTION);
                 if (action != null) {
-                    proxy.getInvocation().getStack().push(
-                            action.getInvocation().getAction());
+                    OgnlValueStack stack = proxy.getInvocation().getStack();
+                    Object top = stack.pop();
+                    stack.push(action.getInvocation().getAction());
+                    stack.push(top);
                 }
             }
             proxy.execute();

Modified: struts/action2/trunk/core/src/main/resources/struts-default.xml
URL: 
http://svn.apache.org/viewvc/struts/action2/trunk/core/src/main/resources/struts-default.xml?rev=415054&r1=415053&r2=415054&view=diff
==============================================================================
--- struts/action2/trunk/core/src/main/resources/struts-default.xml (original)
+++ struts/action2/trunk/core/src/main/resources/struts-default.xml Sat Jun 17 
13:12:40 2006
@@ -67,14 +67,6 @@
                 <interceptor-ref name="basicStack"/>
             </interceptor-stack>
 
-            <!-- Sample Struts Inversion of Control stack
-                 Note: Struts's IoC is deprecated - please
-                 look at alternatives such as Spring -->
-            <interceptor-stack name="componentStack">
-                <interceptor-ref name="component"/>
-                <interceptor-ref name="basicStack"/>
-            </interceptor-stack>
-
             <!-- Sample model-driven stack  -->
             <interceptor-stack name="modelDrivenStack">
                 <interceptor-ref name="model-driven"/>


Reply via email to