You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sanjay Patel <sk...@gmail.com> on 2009/12/30 02:29:46 UTC

Custom interceptor stack not working

Hi,

I am using this simple interceptor configuration, just following
http://struts.apache.org/2.1.8/docs/interceptor-configuration.html :

<struts>
    <package name="default" namespace="/" extends="struts-default">

        <interceptors>
          <interceptor name="security" class="root.SecurityInterceptor"/>
          <interceptor-stack name="secureStack">
            <interceptor-ref name="security"/>
            <interceptor-ref name="defaultStack"/>
          </interceptor-stack>
        </interceptors>

        <default-interceptor-ref name="secureStack"/>

        <global-results>
           <result name="login">/WEB-INF/content/index.jsp</result>
        </global-results>
    </package>
    <constant name="struts.devMode" value="true" />
</struts>

My class definition goes like this:

public class SecurityInterceptor extends AbstractInterceptor {

    public String intercept( ActionInvocation actionInvocation ) throws
Exception {
        throw new Exception();
    }
}

I am scratching my head long since but it simply is not working. Any clues
would help a lot.

-- 
Thanks,
Sanjay
www.sanjaypatel.name

Re: Custom interceptor stack not working

Posted by Sanjay Patel <sk...@gmail.com>.
it looks ok to me, You can compare your solution to mine described here:

>
> http://poulwiel.blogspot.com/2009/01/intercepting-all-actions-inside-my-app.html
>
>
Pawel, great! I got it. I was missing this:

and also this line in struts.properties:

struts.convention.default.parent.package=default

Thanks for your instant support and informative blog post.

Sanjay
www.sanjaypatel.name

Re: Custom interceptor stack not working

Posted by Paweł Wielgus <po...@gmail.com>.
Hi Sanjay,
it looks ok to me, You can compare your solution to mine described here:
http://poulwiel.blogspot.com/2009/01/intercepting-all-actions-inside-my-app.html

Best greetings,
Paweł Wielgus.




2009/12/30 Sanjay Patel <sk...@gmail.com>:
> Hi,
>
> I am using this simple interceptor configuration, just following
> http://struts.apache.org/2.1.8/docs/interceptor-configuration.html :
>
> <struts>
>    <package name="default" namespace="/" extends="struts-default">
>
>        <interceptors>
>          <interceptor name="security" class="root.SecurityInterceptor"/>
>          <interceptor-stack name="secureStack">
>            <interceptor-ref name="security"/>
>            <interceptor-ref name="defaultStack"/>
>          </interceptor-stack>
>        </interceptors>
>
>        <default-interceptor-ref name="secureStack"/>
>
>        <global-results>
>           <result name="login">/WEB-INF/content/index.jsp</result>
>        </global-results>
>    </package>
>    <constant name="struts.devMode" value="true" />
> </struts>
>
> My class definition goes like this:
>
> public class SecurityInterceptor extends AbstractInterceptor {
>
>    public String intercept( ActionInvocation actionInvocation ) throws
> Exception {
>        throw new Exception();
>    }
> }
>
> I am scratching my head long since but it simply is not working. Any clues
> would help a lot.
>
> --
> Thanks,
> Sanjay
> www.sanjaypatel.name
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org