Revision: 1120
          http://stripes.svn.sourceforge.net/stripes/?rev=1120&view=rev
Author:   bengunter
Date:     2009-03-26 04:06:23 +0000 (Thu, 26 Mar 2009)

Log Message:
-----------
Fixed STS-671, which is related to STS-565. The root of the problem is that we 
often end up with the ExecutionContext and ActionBean using two different 
ActionBeanContext instances in the same request. To fix that, DispatcherHelper, 
after resolving the ActionBean for the request, will then check to see if the 
bean's context instance is different from the one in the ExecutionContext. If 
so, then it will take the bean's context, copy the event name from the 
ExecutionContext to it (normally null) and then pass it to 
ExecutionContext.setActionBeanContext().

Modified Paths:
--------------
    trunk/stripes/src/net/sourceforge/stripes/controller/DispatcherHelper.java

Modified: 
trunk/stripes/src/net/sourceforge/stripes/controller/DispatcherHelper.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/controller/DispatcherHelper.java  
2009-03-12 01:21:56 UTC (rev 1119)
+++ trunk/stripes/src/net/sourceforge/stripes/controller/DispatcherHelper.java  
2009-03-26 04:06:23 UTC (rev 1120)
@@ -108,6 +108,15 @@
                 ActionBean bean = 
StripesFilter.getConfiguration().getActionResolver().getActionBean(context);
                 ctx.setActionBean(bean);
 
+                // Prefer the context from the resolved bean if it differs 
from the ExecutionContext
+                if (context != bean.getContext()) {
+                    ActionBeanContext other = bean.getContext();
+                    other.setEventName(context.getEventName());
+
+                    context = other;
+                    ctx.setActionBeanContext(context);
+                }
+
                 // Then register it in the Request as THE ActionBean for this 
request
                 HttpServletRequest request = context.getRequest();
                 request.setAttribute(StripesConstants.REQ_ATTR_ACTION_BEAN, 
bean);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to