ActionBeanContext getEventName() does not return the right event when using 
redirection and bean flash
------------------------------------------------------------------------------------------------------

                 Key: STS-565
                 URL: http://www.stripesframework.org/jira/browse/STS-565
             Project: Stripes
          Issue Type: Bug
    Affects Versions: Release 1.5
         Environment: Affects Stripes revision 905
            Reporter: Christian Poitras


If I return a RedirectResolution calling a method from current action bean and 
I flash the action bean, the event in action bean's context is not correct.

Let's say I have 2 handler.
public Resolution update() {
  return new RedirectResolution(this.getClass(), "done").flash(this);
}
public Resolution done() {
  System.out.println(context.getEventName());
  return new ForwardResolution("/index.jsp");
}

The output will be "update" instead of "done".

The problem is described in this email I've sent to the list.


I narrowed down the problem to a combination of what 
AnnotatedClassActionResolver and DispathHelper do.

In AnnotatedClassActionResolver method ActionBean 
getActionBean(ActionBeanContext context, String path):
The bean returned is the bean from previous request and the ActionBeanContext 
is not updated except for request property.
Then DispatchHelper sets the bean as ActionBean in ExecutionContext, but does 
not update ExecutionContext's ActionBeanContext.

When DispatchHelper sets the event name, it sets in in ExecutionContext's 
ActionBeanContext, but not in ActionBean's ActionBeanContext.
So we have 2 different events. One in ExecutionContext and one in the 
ActionBean.

The Wizard throws an exception because it checks startEvents againts 
ActionBean's context which is not the event that will be called.

A possible patch is to update eventName in ActionBean's ActionBeanContext in 
DispatchHelper's resolveHandler method.
Path is included in email.

Christian

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to