Hi,

I am trying to use the following simple interceptor test the interceptor
concepts but is not happened while calling the action class.



Sample interceptor class.



*import* *com.opensymphony.xwork2.ActionContext*;

*import* com.opensymphony.xwork2.ActionInvocation;

*import* com.opensymphony.xwork2.interceptor.AbstractInterceptor;



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



      @Override

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

            // *TODO* Auto-generated method stub

            System.*out*.println("Testing the interceptor  : calling the
interceptor sample");

            *return* "success";

      }



}



I configured in the struts.xml for my action class using  below config.



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



*  <interceptors>*

*            <interceptor name="sample" class="sample.**InterceptorSample* *
"/>*

*  </interceptors>*





        <action name=*"test"* class=*"test.QuizAction"*>



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



                  <result name=*"success"*>/input.*jsp*</result>

                  <result name=*"error"*>/input.*jsp*</result>

                  <result name=*"input"*>/input.*jsp*</result>

                  </action>

    </package>





I noted nothing printed and anyone can help to resolve the issue.


Thanks

Yanto

Reply via email to