2012年10月8日

摘要: Spring实现动态代理配置是有两种配置文件:1、 xml文件方式;2、 annotation方式(使用AspectJ类库实现的。)一、 AOP配置annotation方式(一) 搭建annotation开发环境首先:需要在配置文件中加入@AspectJ标签<aop:aspectj-autoproxy/>自动帮我产生代理注意:Spring默认并没有加入aop的xsd文件,因为我们需要手动加入(红色部分)<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="htt 阅读全文
posted @ 2012-10-08 16:55 zhuaijun 阅读(241) 评论(0) 推荐(0) 编辑
 
摘要: 事务配置首先在/WEB-INF/applicationContext.xml添加以下内容:<!-- 配置事务管理器 --><bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory"> <ref bean="mySessionFactory"/> </prop 阅读全文
posted @ 2012-10-08 16:42 zhuaijun 阅读(173) 评论(0) 推荐(0) 编辑