'cos that's the way that Stripes works. ctx.proceed() doesn't actually call the method; it just jumps to the next stage in the lifecycle. In this case we're bound to LifecycleStage.HandlerResolution.

@Intercepts(Lifecyclestage.HandlerResolution)
...intercept(ExecutionContext ctx)
{
     // This is executed before the handler is resolved
     before();

     Resolution res = ctx.proceed();

     // This is executed after the handler is resolved
     after();

// If this method returns null, then Stripes will proceed to the next lifecycle stage: BindingAndValidation. It can also throw // an exception, or return a custom Resolution to interrupt the normal execution.

     return res;
}

http://www.stripesframework.org/display/stripes/Intercept+Execution

/Janne

On Sep 11, 2010, at 04:41 , Les Hazlewood wrote:

Hi Janne,

Looks good!  I just have one question though - wouldn't you want to
assert that the method invocation is authorized _before_ calling
ctx.proceed()?  It seems more logical to perform the check first and
only then call the method if allowed to do so.

Cheers,

Les

On Fri, Sep 10, 2010 at 1:24 PM, Janne Jalkanen
<[email protected]> wrote:
Folks,

I wrote some glue code so that Shiro can be used also by the Stripes
framework (http://www.stripesframework.org). Initial writeup is here:

http://www.ecyrd.com/ButtUgly/wiki/Main_blogentry_100910_1

Let me know if there are issues or if I somehow misunderstood the AOP
paradigm that Shiro uses, as the documentation is a bit thin.

/Janne


Reply via email to