Here's the setup servlet-context.xml:
The logicImpl (in applicationContext-hibernate)Code:<bean id="breakInjector" class="ks.rah.avik2.web.form.support.AddHtmlBreakInterceptor"/> <bean id="breakInjectorTarget" class="ks.rah.avik2.logic.LogicFacadeImpl"> <property name="sessionFactory"><ref bean="sessionFactory"/></property> </bean> <!-- Interceptor to inject <br>-tags into output --> <bean id="breakInjectorPointcut" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor"> <property name="advice"><ref local="breakInjector"/></property> <property name="patterns"> <list> <value>.*</value> </list> </property> </bean> <bean id="debugInterceptor" class="org.springframework.aop.interceptor.DebugInterceptor"> </bean> <bean id="breakInjectorProxy" class="org.springframework.aop.framework.ProxyFactoryBean"> <property name="proxyInterfaces"><value>ks.rah.avik2.logic.LogicFacade</value></property> <property name="target"><ref bean="logic"/></property> <property name="interceptorNames"> <list> <value>breakInjector</value> <value>debugInterceptor</value> </list> </property> </bean>
Relevant method of interceptor:Code:<bean id="logicImpl" class="ks.rah.avik2.logic.LogicFacadeImpl"> <property name="sessionFactory"><ref local="sessionFactory"/></property> <property name="userDao"><ref local="userDao"/></property> <property name="eventDao"><ref local="eventDao"/></property> <property name="posDao"><ref local="positionDao"/></property> <property name="deptDao"><ref local="departmentDao"/></property> <property name="locDao"><ref local="locationDao"/></property> <property name="uiDao"><ref local="uiDao"/></property> <property name="funcDao"><ref local="funcDao"/></property> <property name="tentryDao"><ref local="tentryDao"/></property> </bean>
No traces from log or System.out. No 'Holy smoke!'. Zip. Zero.Code:public class AddHtmlBreakInterceptor implements MethodInterceptor { public static Logger log = Logger.getLogger("AddHtmlBreakInterceptor"); public Object invoke(MethodInvocation invocation) throws Throwable{ log.debug("AddHtmlBreakInterceptor invoked"); System.out.println("Holy smoke!"); return invocation.proceed(); }
I thought that '.*' meant any method/pattern.
Help please.


Reply With Quote