You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by Janne Jalkanen <Ja...@ecyrd.com> on 2010/09/10 22:24:21 UTC
Stripes integration
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
Re: Stripes integration
Posted by Janne Jalkanen <Ja...@ecyrd.com>.
'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
> <Ja...@ecyrd.com> 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
>>
Re: Stripes integration
Posted by Les Hazlewood <lh...@apache.org>.
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
<Ja...@ecyrd.com> 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
>