ssm整合的spring.xml文件配置(applicationContext.xml)

xml version="1.0" encoding="UTF-8"?>
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

<context:component-scan base-package="com.aaa.ssm.service">context:component-scan>

name="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
name="driverClassName" value="oracle.jdbc.driver.OracleDriver">
name="url" value="jdbc:oracle:thin:@localhost:1521:orcl">
name="username" value="scott">
name="password" value="tiger">


class="org.mybatis.spring.SqlSessionFactoryBean">
name="dataSource" ref="dataSource">

name="mapperLocations" value="classpath:com/aaa/ssm/dao/*.xml">


class="org.mybatis.spring.mapper.MapperScannerConfigurer">

name="basePackage" value="com.aaa.ssm.dao">



id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
name="dataSource" ref="dataSource">


<tx:annotation-driven transaction-manager="transactionManager">tx:annotation-driven>

转载于:https://www.cnblogs.com/b6952/p/10939504.html

你可能感兴趣的:(ssm整合的spring.xml文件配置(applicationContext.xml))