spring.xml profile

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<!--扫描service包-->
<context:component-scan base-package="ssm.shiro.service.impl"></ context: Component-Scan>
<- Create a data source connection pool dbcp ->!
<context:property-placeholder location="classpath:jdbc.properties"></context:property-placeholder>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="${driver}"></property>
<property name="url" value="${url}"></property>
<property name="username" value="${user}"></property>
<property name="password" value="${password}"></property>
</bean>
<!--创建mybatis的SqlSessionFactory工厂类对象-->
<bean class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<!---->
<!--<property name="configLocation" value="classpath:mybatis.xml"></property>-->
<-! Address specified here mapper file can be configured using the same asterisk, meaning that all of the load at the end of the xml packet mapper file ->
<Property name = "mapperLocations" value = "the CLASSPATH:. / Mapper / * xml "> </ Property>
</ the bean>
<-! configuration of the scanning mybatis dao interface, the interface creates dao interface class object is myabtis dao, placed into the session factory ->
<the bean class =" org.mybatis .spring.mapper.MapperScannerConfigurer ">
<Property name =" basePackage "value =" ssm.shiro.dao "> </ Property>
</ bean>
<-! declaration spring things Manager object ->
<bean the above mentioned id = "the transactionManager" class = "org.springframework.jdbc.datasource.DataSourceTransactionManager">
<Property name = "the dataSource" REF = "the dataSource"> </ Property>
</ the bean>
<!Things statement annotation disposed of spring - ->
<tx: Transaction-Driven-Annotation Manager = "transactionManager"> </ tx: Annotation-Driven>
<! - the introduction of an integrated spring and shiro main configuration file ->
<Import Resource = "CLASSPATH: spring-shiro.xml"> </ Import>
</ Beans>

Guess you like

Origin www.cnblogs.com/yinziqiang0909/p/11205997.html