码迷,mamicode.com
首页 > 编程语言 > 详细

spring-service.xml 模板

时间:2018-12-19 14:17:46      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:context   sof   schema   count   scan   inline   margin   star   instance   

  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:context="http://www.springframework.org/schema/context" 
  5. xmlns:tx="http://www.springframework.org/schema/tx" 
  6. xsi:schemaLocation="http://www.springframework.org/schema/beans 
  7. http://www.springframework.org/schema/beans/spring-beans.xsd 
  8. http://www.springframework.org/schema/context 
  9. http://www.springframework.org/schema/context/spring-context.xsd 
  10. http://www.springframework.org/schema/tx 
  11. http://www.springframework.org/schema/tx/spring-tx.xsd"> 
  12. <!-- 扫描service包下所有使用注解的类型 --> 
  13. <context:component-scan base-package="com.ryanjie.o2o.service"/> 
  14.  
  15. <!-- 配置事务管理器 --> 
  16. <bean id="transactionManager" 
  17. class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> 
  18. <!-- 注入数据库连接池 --> 
  19. <property name="dataSource" ref="dataSource"/> 
  20. </bean> 
  21.  
  22. <!-- 配置基于注解的声明式事务 --> 
  23. <tx:annotation-driven transaction-manager="transactionManager"/> 
  24. </beans> 

spring-service.xml 模板

标签:context   sof   schema   count   scan   inline   margin   star   instance   

原文地址:https://www.cnblogs.com/Ryanjie/p/10142719.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!