在一个applicationContext.xml文件中的代码
<arid:define-beans package="kr.ac.bsac.is" pattern="*..service.*Service || *..dao.*DAO" autowire="byName"/> <aop:config>
<aop:pointcut id="serviceOperation" expression="execution(* kr.ac.gdc.is..service.*Service.*(..))"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="serviceOperation"/>
</aop:config>
不知道是做什么的
<arid:define-beans package="kr.ac.bsac.is" pattern="*..service.*Service || *..dao.*DAO" autowire="byName"/> <aop:config>
<aop:pointcut id="serviceOperation" expression="execution(* kr.ac.gdc.is..service.*Service.*(..))"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="serviceOperation"/>
</aop:config>
不知道是做什么的
解决方案 »
- 求物品在图片上定位的问题(100分)!!!
- 简单的问题
- 為什麼jsp在執行sql語句時把table名轉換成大寫的了
- ------在先客服实现原理。
- 在jsp中如果获得上传的文件
- 极简单问题--JSP中的虚拟目录我搞不定
- 大家快来
- 怎样才能在Tomcat中装SQLServer 2000的JDBC驱动?
- jbuilder8+Weblogic 7调试jsp问题求助
- JBuilder工程中Tomcat的数据库连接池配置问题
- MissingResourceException: Can't find bundle for base name WEB-INF.classes.config...怎解决?
- subtring取值问题
<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<tx:method name="get*" read-only="true"/>
<tx:method name="find*" read-only="true"/>
<tx:method name="view*" read-only="true"/>
<tx:method name="save*" propagation="REQUIRED"/>
<tx:method name="*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>
Spring 2.0的新配置:
如果如果service没有基于接口,使用cgilib来实现AOP<aop:config proxy-target-class="true">
<aop:advisor pointcut="execution(* com.xyz.service..*Manager.*(..))" advice-ref="txAdvice"/>
<aop:advisor pointcut="execution(* com.xyz.service..*Manager.save(..))" advice-ref="fooAdvice"/>
</aop:config>
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="get*" read-only="true"/>
<tx:method name="find*" read-only="true"/>
<tx:method name="*" />
</tx:attributes>
</tx:advice>
execution(* *..BookManager.save(..))的解读:
第一颗* 代表ret-type-pattern 返回值可任意,
*..BookManager 代表任意Pacakge里的BookManager类。
如果写成com.xyz.service.* 则代表com.xyz.service下的任意类
com.xyz.service..* com.xyz.service则代表com.xyz.service及其子package下的任意类
save代表save方法,也可以写save* 代表saveBook()等方法 <arid:define-beans package="kr.ac.bsac.is" pattern="*..service.*Service || *..dao.*DAO" autowire="byName"/>
不知道这个什么API