读书人

Spring事宜配置的通配符的说明

发布时间: 2012-08-27 21:21:57 作者: rapoo

Spring事务配置的通配符的说明
例子:

 <aop:config>        <aop:pointcut id="interceptorPointCuts"            expression="execution(* com.yan.service.impl.*.*(..))" />        <aop:advisor advice-ref="txAdvice"            pointcut-ref="interceptorPointCuts" />           </aop:config>  


解释一下(* com.yan.service.impl.*.*(..))中几个通配符的含义:
第一个 * —— 通配 任意返回值类型
第二个 * —— 通配 包com.yan.service.impl下的任意class
第三个 * —— 通配 包com.yan.service.impl下的任意class的任意方法
第四个 .. —— 通配 方法可以有0个或多个参数

读书人网 >软件架构设计

热点推荐