如何在Spring mvc下实现BeanNameAutoProxyCreator 动态代理?????
偶的配置文件如下:
<?xml version="1.0" encoding="GBK"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!--请求动作与Bean的映射-->
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/PlanView.do">PlanView</prop>
</props>
</property>
</bean>
<bean id="PlanView" class="govstock.system.ListViewController">
<property name="listObject"><ref local="PlanImpl"/></property>
<property name="returnView"><value>system/ListView</value></property>
<property name="listCodeName"><value>planCode</value></property>
</bean>
<bean id="PlanImpl" class="govstock.system.PlanImpl">
<property name="sqlMap"><ref bean="sqlMap"/></property>
</bean>
<bean id="ListAutoProxy" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames">
<list>
<value>*Impl</value>
</list>
</property>
<property name="interceptorNames">
<list>
<value>ListAdvisor</value>
</list>
</property>
</bean>
<bean id="ListAdvisor" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">
<property name="advice">
<ref bean="ListAdvice"/>
</property>
<property name="pattern">
<value>.*create*</value>
</property>
</bean>
<bean id="ListAdvice" class="govstock.system.ListAdvice">
<property name="thresholdInMillis"><value>0</value></property>
</bean>
</beans>
注:planImpl实现ListObject接口,里面有createParentList, 等等以create开头命名的方法.
为什么我在请求PlanView.do动作时,我的ListAdvice没有响应呢!
是没有拦截到planImpl,或者是没拦截到planImpl里面的createParentList的方法吗? 还是有其他的原因?
望高手作答!!
谢谢!不省感激!!