Stripes

Interceptor that changes resolution still executes before and after methods in original resolution

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: Release 1.5.6
  • Fix Version/s: None
  • Component/s: Context Management
  • Labels:
    None

Description

I have an interceptor that makes sure that a user can view a particular action bean and or event:

@Intercepts({LifecycleStage.HandlerResolution})
public class ForceLogin implements Interceptor {
@Override public Resolution intercept(ExecutionContext context) throws Exception {
Resolution originalResolution = context.proceed(); //this makes sure event is populated
ActionBean actionBean = (ActionBean) context.getActionBean();
String event = context.getActionBeanContext().getEventName();
if (needsToLogin(actionBean, event)) { return new RedirectResolution(LoginActionBean.class); }
return originalResolution;
}
}

In my original (non-login) action bean, I've defined a before method:

@Before(stages = LifecycleStage.ResolutionExecution)
public void foobar() { foobar.getPumped(); }

Binding and validation never happened for that action bean, so foobar is null. Shouldn't matter though, because we have a new resolution. But for some reason, when executing the new resolution, this before method is getting executed.

Activity

There are no comments yet on this issue.

People

Vote (1)
Watch (1)

Dates

  • Created:
    25/May/11 8:16 PM
    Updated:
    25/May/11 8:16 PM