spring aop expression支持多个表达式配置
2014-06-05 00:11
127 查看
<!-- 配置那些类的方法进行事务管理 -->
<aop:config>
<aop:pointcut id="allServiceMethod" expression="execution (* com.cms.sys.service.*.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="allServiceMethod" />
</aop:config>
还有一个
execution (* com.cms.art.service.*.*(..))"
要怎么写?
可以这样写:将execution分开写。
<aop:config>
<aop:pointcut id="allServiceMethod" expression="(execution (* com.cms.sys.service.*.*(..))) or (execution (* com.cms.art.service.*.*(..)))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="allServiceMethod" />
</aop:config>
老外喜欢吧逻辑运算符用or,and !写,国内一般用|| && !。
参考E文详细的资料:
http://www.jboss.org/file-access/default/members/jbossaop/freezone/docs/2.0.0.GA/docs/aspect-framework/reference/en/html/annotated.htmlhttp://www.jboss.org/file-access/default/members/jbossaop/freezone/docs/2.0.0.GA/docs/aspect-framework/reference/en/html/pointcuts.html
<aop:config>
<aop:pointcut id="allServiceMethod" expression="execution (* com.cms.sys.service.*.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="allServiceMethod" />
</aop:config>
还有一个
execution (* com.cms.art.service.*.*(..))"
要怎么写?
可以这样写:将execution分开写。
<aop:config>
<aop:pointcut id="allServiceMethod" expression="(execution (* com.cms.sys.service.*.*(..))) or (execution (* com.cms.art.service.*.*(..)))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="allServiceMethod" />
</aop:config>
老外喜欢吧逻辑运算符用or,and !写,国内一般用|| && !。
参考E文详细的资料:
http://www.jboss.org/file-access/default/members/jbossaop/freezone/docs/2.0.0.GA/docs/aspect-framework/reference/en/html/annotated.htmlhttp://www.jboss.org/file-access/default/members/jbossaop/freezone/docs/2.0.0.GA/docs/aspect-framework/reference/en/html/pointcuts.html
相关文章推荐
- spring aop expression支持多个表达式配置
- spring aop expression支持多个表达式配置
- spring3.0事务配置及expression表达式介绍
- spring AOP配置中的正则表达式(转)
- spring对AOP的支持(采用配置方式)
- Spring Aop配置时的切入点表达式
- spring对AOP的支持(采用配置文件的方式)
- 【Spring进阶】spring对AOP的支持-注解方式和配置方式
- Spring Aop配置时的切入点表达式
- spring AOP pointcut expression表达式解析
- Spring AOP配置某个类的有返回值类型限制的方法的expression
- 在Spring AOP代理过的对象上支持dubbo annotation配置事物失效问题
- Spring Aop配置时的切入点表达式
- spring aop expression 匹配多个条件 多个表达式
- spring aop expression 匹配多个条件 多个表达式
- Spring Aop配置时的切入点表达式
- 在Spring AOP代理过的对象上支持dubbo annotation配置事物失效问题
- Spring AOP 中pointcut expression表达式解析及配置
- aop-config中expression表达式解析 以及propagation的7种配置的意思
- spring aop配置时,expression里面星的含义