Hi Volker,
thanks, we are able to run the interceptor now, but we have another issue,
the interceptor will Loop,
we create the sample follow the code from the webworks
*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();
}
}
Regards
Yanto
On Wed, Jun 17, 2009 at 7:18 AM, Volker Karlmeier <[email protected]>wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> sounds like you mixed up interceptors and action classes.
> Look at *http://struts.apache.org/2.x/docs/interceptors.html
>
> *regards
>
> Volker
>
> Yanto schrieb:
> > 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
> >
>
>
> - --
> - -------------------------------
>
> Volker Karlmeier
> Friedrich-Freye-Str. 61
> 45481 Mülheim/Ruhr
>
> Tel. : (+49) 208-7785675
> Mobil: (+49) 176-21056587
> Mail : [email protected]
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (GNU/Linux)
>
> iD8DBQFKOCg7aEMQXBIqssERAgRaAKCbsdFrzAFxuk8Rva9B6XVPOy8jeACfQ2XS
> 53yea3su5lVImf1ZabY3JmE=
> =6PTg
> -----END PGP SIGNATURE-----
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>