struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yanto <yantob...@gmail.com>
Subject Re: Interceptor issue in Struts 2.1.6
Date Wed, 17 Jun 2009 03:39:29 GMT
Hi Dave,

after following your note, we are able to run our sample interceptor,
however now we have another issue the sample interceptor will always
looping,

since we have the following code in the sample interceptor,
*return* invocation.invoke();

but the sample interceptor will not run, if we are not include this code.


======================================================================================

<interceptors>

            <interceptor name=*"sample"* class=*
"com.obs.ssts.framework.interceptor.InterceptorSample"*/>



                  <interceptor-stack name=*"MyInterceptorStack"*>

                        <interceptor-ref name=*"prepare"*/>

                        <interceptor-ref name=*"modelDriven"*/>

                        <interceptor-ref name=*"exception"*/>

                        <interceptor-ref name=*"servletConfig"*/>

                        <interceptor-ref name=*"checkbox"*/>

                        <interceptor-ref name=*"params"*/>

                        *<**interceptor-ref** name="**sample"**/>***

                  </interceptor-stack>

      </interceptors>

             <default-interceptor-ref name=*"MyInterceptorStack"*/>

         <action name=*"authentication"* method=*"authentication"* class=*
"loginAction"*>

            <result>main.*jsp*</result>

      </action>



Now my action calls going in loop and after added the myinterceptostack



*public* *class* *InterceptorSample* *extends* AbstractInterceptor {



      @Override

      *public* String intercept(ActionInvocation invocation) *throws*Exception {

            // *TODO* Auto-generated method stub

            System.*out*.println("Testing the interceptor flow from TEST:");

            System.*out*.println("Testing the interceptor flow from TEST
&&&&&:");

            *return* invocation.invoke();

      }



}


Thanks
Yanto


On Tue, Jun 16, 2009 at 7:32 PM, Dave Newton <newton.dave@yahoo.com> wrote:

> Yanto wrote:
>
>> <action name="test" class="test.QuizAction">
>>  <interceptor-ref name="sample" />
>> </action>
>>
>
> This will configure *only* the "sample" interceptor.
>
> If you specify *any* interceptors on a per-action basis you must configure
> *all* interceptors. This can be done in several ways.
>
> - specify all interceptors in the action's configuration (you can specify
> interceptor stacks as well as single interceptors)
> - creating a new stack including your custom interceptor and using that
> stack in your action configuration
> - same, but define the new stack and using it as the default stack
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message