1. 程式人生 > >spring-service.xml 模板

spring-service.xml 模板

initial not mic nsa break Coding over lap frame

ssm模板
  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. <bean id="transactionManager"
  16. class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  17. <!-- 註入數據庫連接池 -->
  18. <property name
    ="dataSource" ref="dataSource"/>
  19. </bean>
  20. <!-- 配置基於註解的聲明式事務 -->
  21. <tx:annotation-driven transaction-manager="transactionManager"/>
  22. </beans>

spring-service.xml 模板