欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

实现Spring AOP 前置通知的配置,springaop,<http://www.

来源: javaer 分享于  点击 16863 次 点评:88

实现Spring AOP 前置通知的配置,springaop,
<http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"><!--注册前置通知类  --><bean id="beforeAdvice" class="org.aop.advice.AdviceBeforeHello"/><!-- 注册接口实现类 --><bean id="hello" class="org.aop.interfaces.impl.Hello"></bean><!-- 注册代理类 --><bean id="proxy" class="org.springframework.aop.framework.ProxyFactoryBean">        <!-- 指定应用的接口 -->        <property name="proxyInterfaces">            <value>org.aop.interfaces.IHello</value>        </property>        <!-- 目标对象,即为Hello对象 -->        <property name="target" ref="hello"></property>        <!-- 应用的前置通知,拦截器名称 -->        <property name="interceptorNames">            <list>                <value>beforeAdvice</value>            </list>        </property>    </bean></beans>//该片段来自于http://byrx.net

相关栏目:

用户点评