[ 
http://www.stripesframework.org/jira/browse/STS-844?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Gunter resolved STS-844.
----------------------------

       Resolution: Fixed
    Fix Version/s: Release 1.5.7
         Assignee: Ben Gunter

Thank you. This was the result of applying the same patch twice.

> duplicate code in DispatcherHelper
> ----------------------------------
>
>                 Key: STS-844
>                 URL: http://www.stripesframework.org/jira/browse/STS-844
>             Project: Stripes
>          Issue Type: Improvement
>          Components: ActionBean Dispatching
>    Affects Versions: Release 1.5.6
>            Reporter: Roman Kosenko
>            Assignee: Ben Gunter
>            Priority: Minor
>             Fix For: Release 1.5.7
>
>
> net.sourceforge.stripes.controller.DispatcherHelper:
>     public static Resolution resolveActionBean(final ExecutionContext ctx) 
> throws Exception {
>         final Configuration config = StripesFilter.getConfiguration();
>         ctx.setLifecycleStage(LifecycleStage.ActionBeanResolution);
>         
> ctx.setInterceptors(config.getInterceptors(LifecycleStage.ActionBeanResolution));
>         return  ctx.wrap( new Interceptor() {
>             public Resolution intercept(ExecutionContext ctx) throws 
> Exception {
>                 // Look up the ActionBean and set it on the context
>                 ActionBeanContext context = ctx.getActionBeanContext();
>                 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());
>                     other.setRequest(context.getRequest());
>                     other.setResponse(context.getResponse());
>                     context = other;
>                     ctx.setActionBeanContext(context);
>                 }
>                 // 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());
>                     other.setRequest(context.getRequest());
>                     other.setResponse(context.getResponse());
>                     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);
>                 return null;
>             }
>         });
>     }
> I think second "if (context != bean.getContext()) {...}" will never run in.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to