<?xml version= "1.0" encoding= "UTF-8"?>
<beans xmlns= "Http://www.springframework.org/schema/beans"
xmlns:context= "Http://www.springframework.org/schema/context"
xmlns:aop= "HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP"
Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"
xmlns:p= "http://www.springframework.org/schema/p"
Xsi:schemalocation= "Http://www.springframework.org/schema/beans
Http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
Http://www.springframework.org/schema/context
Http://www.springframework.org/schema/context/spring-context-3.0.xsd
Http://www.springframework.org/schema/aop
Http://www.springframework.org/schema/aop/spring-aop-3.0.xsd ">
<!--turn on auto-scan beans--
<context:component-scan base-package= "Com.lovo"/>
<!--enable AOP annotation Support--
<aop:aspectj-autoproxy/>
<!--configuration Data source (C3P0)--
<bean id= "DataSource" class= "Com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method= "Close" >
<!--specified database driver
<property name= "Driverclass" value= "Com.mysql.jdbc.Driver"/>
<!--Specify the database URL--
<property name= "Jdbcurl" value= "jdbc:mysql://localhost:3306/cbd_db"/>
<!--Specify database user name--
<property name= "User" value= "root"/>
<!--Specify a database password--
<property name= "Password" value= "root"/>
<!--Specify the maximum number of connections to the connection pool-
<property name= "maxpoolsize" value= "/>"
<!--Specify the connection pool minimum connection number--
<property name= "Minpoolsize" value= "1"/>
<!--Specify the number of connection pool connections initialized (default 3)-
<property name= "Initialpoolsize" value= "2"/>
<!--Specify the connection pool connection timeout time--
<property name= "maxidletime" value= "/>"
<!--Specify the number of connections created when the connection pool is exhausted--
<property name= "Acquireincrement" value= "2"/>
<!--Specifies the connection pool when the thread interval is detected---
<property name= "idleconnectiontestperiod" value= "/>"
</bean>
<!--configuring JDBC Transaction Management--
<bean id= "TransactionManager" class= "Org.springframework.jdbc.datasource.DataSourceTransactionManager" >
<property name= "DataSource" ref= "DataSource"/>
</bean>
<!--configuration Sqlsessionfactory--
<bean id= "Sqlsessionfactory" class= "Org.mybatis.spring.SqlSessionFactoryBean" >
<property name= "DataSource" ref= "DataSource"/>
<property name= "Typealiasespackage" value= "com.lovo.entity"/>
</bean>
<!--Configure mapper scan mode, all mapper inherit Sqlmapper interface--
<bean class= "Org.mybatis.spring.mapper.MapperScannerConfigurer" >
<property name= "Basepackage" value= "Com.lovo.mapper"/>
<property name= "Markerinterface" value= "Com.lovo.mapper.SqlMapper"/>
</bean>
</beans>
The spring configuration file is the/web-inf/application.xml file from the last Web. XML Load Spring container