Hi everyone,
I tried to realize a very simple interception. My interceptor bean is created
but my interceptor is never call. I want to intercept , with a before advice method, any to call to
My regex pattern is :Code:void onClickOnPushMe(ActionEvent e) void setText(String text)
but it failed to do the trick.Code:<value>.*setText*</value> <value>.*onClickOnPushMe*</value>
I add my config.xml's file just below with my interceptor code wich is pretty hallow.
Code:<bean id="textInterceptor" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor"> <property name="advice" ref="userInterceptorImpl"/> <property name="patterns"> <list> <value>.*setText*</value> <value>.*onClickOnPushMe*</value> </list> </property> </bean> <bean id="userInterceptorImpl" class="com.AO.SpringAppContext.app.TextInterceptor"/>Thanks !Code:public class TextInterceptor implements MethodBeforeAdvice { private static Logger _log = Logger.getLogger("INTERCEPTOR:"); public TextInterceptor() { _log.info("Creating UserInterceptor"); } public void before(Method arg0, Object[] arg1, Object arg2) throws Throwable { _log.info("INTERCEPTION !"); } }


Reply With Quote
