<?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:aop="http://www.springframework.org/schema/aop"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:elasticsearch="http://www.pilato.fr/schema/elasticsearch"
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-4.2.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.2.xsd
http://www.pilato.fr/schema/elasticsearch http://www.pilato.fr/schema/elasticsearch/elasticsearch-5.0.xsd">
<!-- 寮曞叆db.properties -->
<context:property-placeholder location="classpath:db.properties"/>
<!-- 浣跨敤Annotation鑷姩娉ㄥ唽Bean锛岃В鍐充簨鐗╁け鏁堥棶棰橈細鍦ㄤ富瀹瑰櫒涓笉鎵弿@Controller娉ㄨВ锛屽湪SpringMvc涓彧鎵弿@Controller娉ㄨВ銆? -->
<context:component-scan base-package="com.fendo"><!-- base-package 濡傛灉澶氫釜锛岀敤鈥?,鈥濆垎闅? -->
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>
<!-- 閰嶇疆鏁版嵁婧恈3p0 -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="user" value="pro"></property>
<property name="password" value="pro"></property>
<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/pro?useUnicode=true&characterEncoding=UTF-8"></property>
<property name="driverClass" value="com.mysql.jdbc.Driver"></property>
<property name="initialPoolSize" value="5"></property>
<property name="maxPoolSize" value="10"></property>
</bean>
<!-- 閰嶇疆SqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 01.寮曞叆鏁版嵁婧? -->
<property name="dataSource" ref="dataSource"></property>
<!-- 02.鍔犺浇MyBatis閰嶇疆鏂囦欢 -->
<property name="configLocation" value="classpath:myBatisConfig.xml"></property>
<!-- 03.鍔犺浇MyBatis鏄犲皠鏂囦欢 -->
<!-- <property name="mapperLocations" value="classpath:com/fendo/mapper/*.xml"></property> -->
</bean>
<!-- 鎵弿basePackage涓嬫墍鏈変互@MyBatisDao娉ㄨВ鐨勬帴鍙? -->
<bean id="mapperScannerConfigurer" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
<property name="basePackage" value="com.fendo.mapper"/>
</bean>
<!-- 閰嶇疆澹版槑寮忎簨鍔$鐞? -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<!--閰嶇疆浜嬪姟浼犳挱鎬э紝闅旂绾у埆浠ュ強瓒呮椂鍥炴粴绛夐棶棰? -->
<tx:attributes>
<tx:method name="save*" propagation="REQUIRED"/>
<tx:method name="del*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="add*" propagation="REQUIRED"/>
<tx:method name="*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
<!-- Spring AOP config
瑙i噴涓?涓?(* com.evan.crm.service.*.*(..))涓嚑涓?氶厤绗︾殑鍚箟锛?
绗竴涓? * 鈥斺?? 閫氶厤 浠绘剰杩斿洖鍊肩被鍨?
绗簩涓? * 鈥斺?? 閫氶厤 鍖卌om.evan.crm.service涓嬬殑浠绘剰class
绗笁涓? * 鈥斺?? 閫氶厤 鍖卌om.evan.crm.service涓嬬殑浠绘剰class鐨勪换鎰忔柟娉?
绗洓涓? .. 鈥斺?? 閫氶厤 鏂规硶鍙互鏈?0涓垨澶氫釜鍙傛暟
-->
<!-- 閰嶇疆鍒囬潰 -->
<aop:config expose-proxy="true" proxy-target-class="true">
<!--閰嶇疆浜嬪姟鍒囩偣 -->
<aop:pointcut id="services" expression="execution(* com.fendo.service.impl.*.*(..))"/>
<aop:advisor pointcut-ref="services" advice-ref="txAdvice"/>
</aop:config>
</beans>
没有合适的资源?快使用搜索试试~ 我知道了~
使用maven Filtering实现多环境构建
共28个文件
properties:10个
xml:9个
prefs:2个
需积分: 50 11 下载量 68 浏览量
2017-09-08
23:12:35
上传
评论 1
收藏 26KB ZIP 举报
温馨提示
使用maven Filtering实现多环境构建,详细请参考:http://blog.csdn.net/u011781521/article/details/77899467
资源推荐
资源详情
资源评论
收起资源包目录
Profiles.zip (28个子文件)
Profiles
.project 560B
src
test
java
main
webapp
WEB-INF
web.xml 1KB
index.jsp 57B
resources
applicationContext.xml 4KB
profiles
test.properties 190B
dev.properties 186B
pro.properties 188B
springmvc.xml 2KB
java
target
Profiles.war 7KB
maven-status
maven-compiler-plugin
testCompile
default-testCompile
inputFiles.lst 0B
compile
default-compile
inputFiles.lst 0B
classes
applicationContext.xml 4KB
profiles
test.properties 190B
dev.properties 186B
pro.properties 188B
springmvc.xml 2KB
Profiles
WEB-INF
classes
applicationContext.xml 4KB
profiles
test.properties 190B
dev.properties 186B
pro.properties 188B
springmvc.xml 2KB
web.xml 1KB
index.jsp 57B
META-INF
maven-archiver
pom.properties 116B
.settings
org.eclipse.m2e.core.prefs 90B
org.eclipse.jdt.core.prefs 736B
pom.xml 3KB
.classpath 1KB
共 28 条
- 1
资源评论
码农致富
- 粉丝: 3670
- 资源: 112
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功