SSI开发:applicationContext-common.xml标准配置模板
来源:互联网 发布:linux 查看权限命令 编辑:程序博客网 时间:2024/05/16 23:39
<!-- 自动搜索@Component , @Service , @Repository等标注的类 ,不搜索@Controller的类 ,@Controller的类在mvc.xml中搜索-->
<!-- 自动扫描组件,这里要把web下面的 controller去除,他们是在spring3-servlet.xml中配置的,如果不去除会影响事务管理的。 -->
<context:component-scan base-package="custom define package" annotation-config="true">
<context:exclude-filter type="annotation"
expression="org.springframework.stereotype.Controller" />
</context:component-scan>
<!-- enable autowire -->
<context:annotation-config />
<aop:aspectj-autoproxy proxy-target-class="true"/>
<!-- 启用缓存注解功能 -->
<cache:annotation-driven cache-manager="cacheManager"/>
<!-- define the SqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="c3p0" />
<!-- ORM映射文件 -->
<!-- 自定义mybatis-config.xml -->
<property name="configLocation" value="classpath:/ibatis/mybatis-config.xml" />
</bean>
<!-- sqlMapper与Mapper.xml映射 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!-- ORM映射文件具体位置:eg:com/prjname/dao.ibatis/sqlMapper -->
<property name="basePackage" value="com/prjname/dao.ibatis/sqlMapper" />
</bean>
<!-- ================================配置事务相关控制================================================= -->
<!-- 数据库连接池 -->
<!-- eg:/WEB-INF/springspring-pool.xml -->
<import resource="classpath:/spring/spring-pool.xml" />
<!-- 事务管理器 -->
<bean name="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="c3p0"></property>
</bean>
<!-- 配置事务特性 -->
<tx:advice id="transactionAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="delete*" propagation="REQUIRED" read-only="false"
rollback-for="java.lang.Exception" />
<tx:method name="insert*" propagation="REQUIRED" read-only="false"
rollback-for="java.lang.Exception" />
<tx:method name="update*" propagation="REQUIRED" read-only="false"
rollback-for="java.lang.Exception" />
<tx:method name="modify*" propagation="REQUIRED" read-only="false"
rollback-for="java.lang.Exception" />
<tx:method name="*" propagation="SUPPORTS" read-only="true" />
</tx:attributes>
</tx:advice>
<!-- 配置AOP切面 哪些类的方法需要进行事务管理 -->
<aop:config>
<!--把事务控制在Service层 -->
<!-- eg:exceution( public * com.prjname.service.. * ) -->
<aop:pointcut id="allManagerMethod" expression="execution(public * com.prjname.service..*.*(..))" />
<aop:advisor pointcut-ref="allManagerMethod" advice-ref="transactionAdvice" />
</aop:config>
<!-- service层的属性和配置文件读入 ,多个用逗号隔开 -->
<!-- controller层的属性和配置文件读入 ,多个用逗号隔开 -->
<context:property-placeholder
location="classpath:/ibatis/jdbc.properties" />
<!-- cacheManager工厂类 -->
<bean id="cacheManagerFactory" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"
p:configLocation="classpath:/cache/ehcache.xml" />
<!-- 声明cacheManager -->
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager"
p:cacheManager-ref="cacheManagerFactory"/>
- SSI开发:applicationContext-common.xml标准配置模板
- SSI开发:web.xml标准配置模板
- SSI开发:ehcache.xml标准配置模板
- SSI开发:spring-pool.xml标准配置模板
- SSI开发:mybatis-config.xml标准配置模板
- applicationContext.xml 配置模板
- applicationContext-common.xml
- applicationContext.xml文件模板
- applicationContext.xml配置
- applicationContext.xml 配置说明
- applicationContext.xml配置分析
- struts2-applicationContext.xml配置
- applicationContext.xml 配置说明
- applicationContext.xml 配置说明
- spring applicationContext.xml配置
- applicationContext.xml 配置方法
- applicationContext.xml 配置说明
- 配置applicationcontext.xml文件
- 在线发短信网站的程序讲解
- CodeIgniter 核心代码阅读-加载类Loader.php
- asp.net读取xlsx
- java 代理模式
- Linux口袋书(第2版)
- SSI开发:applicationContext-common.xml标准配置模板
- 向Richedit插入动态Gif的实现(关于QQ表情功能的制作)
- 【Office超级技巧连载─Excel工作簿技巧】
- HTTP协议详解
- 【假如电脑的散热大户显卡溫度过高怎么办】
- 先产品,再战略,最后是商业模式
- Debian 添加普通用户并添加sudo权限
- Mongodb初始化配置开发
- 电容触摸屏驱动---基于FT5406