日期:2014-05-16  浏览次数:20623 次

Spring3+mybatis+mysql整合详解(三)

下面来看Spring的配置:

1、applicationContext.xml

?

Xml代码 复制代码?收藏代码
  1. <?xml?version="1.0"?encoding="UTF-8"?>??
  2. <beans?xmlns="http://www.springframework.org/schema/beans"??
  3. ??xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"??
  4. ??xmlns:aop="http://www.springframework.org/schema/aop"??
  5. ??xmlns:tx="http://www.springframework.org/schema/tx"??
  6. ??xsi:schemaLocation=" ??
  7. ??http://www.springframework.org/schema/beans?http://www.springframework.org/schema/beans/spring-beans-2.5.xsd ??
  8. ??http://www.springframework.org/schema/tx?http://www.springframework.org/schema/tx/spring-tx-2.5.xsd ??
  9. ??http://www.springframework.org/schema/aop?http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">??? ??
  10. ????<!--?DAO配置?-->??
  11. ????<import?resource="daoContext.xml"?/>??
  12. ???? ??
  13. ????<!--?IoC配置?-->??
  14. ????<import?resource="iocContext.xml"?/>