<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:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"
default-lazy-init="true">
<!--系统管理配置文件 结束 -->
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="systemPropertiesModeName"
value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
<property name="ignoreResourceNotFound" value="true" />
<property name="locations">
<list>
<value>classpath:webpoint-config.properties</value>
</list>
</property>
</bean>
<bean id="dataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<!--
<value>java:comp/env/jdbc/iap</value>
<value>jdbc/iap</value>
-->
<value>java:comp/env/jdbc/iap</value>
</property>
</bean>
<!--
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="namingStrategy">
<bean class="org.hibernate.cfg.ImprovedNamingStrategy" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
${spring.hibernate.dialect}
</prop>
<prop key="hibernate.show_sql">
${spring.hibernate.show_sql}
</prop>
<prop key="hibernate.cache.provider_class">
${spring.hibernate.cache.provide_class}
</prop>
<prop
key="hibernate.cache.provider_configuration_file_resource_path">
${spring.hibernate.cache.provider_file_path}
</prop>
</props>
</property>
<property name="packagesToScan"
value="${spring.hibernate.annotated_packages}" />
</bean> -->
<bean id="sqlMapClient"
class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation">
<value>classpath:sql-map-config.xml</value>
</property>
<property name="dataSource" ref="dataSource" />
</bean>
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
<context:component-scan base-package="com.tydic" />
<context:annotation-config />
<aop:aspectj-autoproxy />
<!-- 性能分析 @Profiled(tag = "dynamicTag_{$0}") -->
<bean id="timingAspect" class="org.perf4j.log4j.aop.TimingAspect" />
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager"
proxy-target-class="true" />
<bean id="defaultCacheManager"
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation">
<value>${spring.ehcache.class_file_path}</value>
</property>
</bean>
<bean id="authorityCache"
class="org.springframework.cache.ehcache.EhCacheFactoryBean">
<property name="cacheManager" ref="defaultCacheManager" />
<property name="cacheName">
<value>authorityCache</value>
</property>
</bean>
<bean id="userServiceCache"
class="org.springframework.cache.ehcache.EhCacheFactoryBean">
<property name="cacheManager" ref="defaultCacheManager" />
<property name="cacheName">
<value>userServiceCache</value>
</property>
</bean>
<bean id="ehcacheInterceptor"
class="com.tydic.webpoint.core.cache.ehcache.EhcacheInterceptor">
<property name="caches">
<map>
<!-- 可以配置多个cache类型 -->
<entry key="defaultCache">
<ref local="authorityCache" />
</entry>
<entry key="userServiceCache">
<ref local="userServiceCache" />
</entry>
</map>
</property>
</bean>
<bean
class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames">
<list>
<value>*Service</value>
</list>
</property>
<property name="interceptorNames">
<list>
<!--
<value>logInterceptor</value>
-->
<value>perf4jInterceptor</value>
<value>ehcacheInterceptor</value>
</list>
</property>
</bean>
<bean
class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames">
<list>
<value>*Detail</value>
</list>
</property>
<property name="interceptorNames">
<list>
<value>ehcacheInterceptor</value>
</list>
</property>
</bean>
<import resource="classpath:applicationContext-sys.xml" />
<import resource="classpath:applicationContext-iap.xml" />
<!--
<import resource="classpath:applicationContext-cxf.xml" />
<import resource="classpath:spring.quartz.xml" />
-->
<aop:config>
<aop:pointcut id="templateServiceMethods"
expression="execution(* com.tydic.webpoint.core.service..*.*(..))" />
<aop:advisor advice-ref="txAdvice"
pointcut-ref="templateServiceMethods" />
</aop:config>
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="*" read-only="true" />
<tx:method name="batch*" propagation="REQUIRED" />
<tx:method name="add*" propagation="REQUIRED" />
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="insert*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="edit*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="remove*" propagation="REQUIRED" />
<tx:method name="do*" propagation="REQUIRED" />
<tx:method name="on*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
</beans>
相关推荐
- Application context definition for JPetStore's business layer. - Contains bean references to the transaction manager and to the DAOs in - dataAccessContext-local/jta.xml (see web.xml's ...
Spring项目application.xml配置文件加解密
初次使用ssm框架的朋友可以看一下,希望对你有所帮助
Spring Boot技术知识点:如何获取application.yml配置文件里的相关属性
Starting with the architecture of the Spring Framework and setting up the key components of the Spring application development environment, you will learn the configuration of Spring Container and how...
本篇文章主要介绍了详解spring applicationContext.xml 配置文件 ,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
@ImportResource(value = {"classpath:spring/spring-jdbc.xml"}) application.properties配置: #数据库配置 datasource.url = jdbc:mysql://127.0.0.1:3306/数据库名?useUnicode=true&characterEncoding=UTF-8&...
spring+jpa的applicationContext.xml配置
spring和hibernate帮助文档,还有就是dtd文件
包含applicationContext.xml、db.properties、log4j.properties、spring-mvc.xml文件,方便搭建,省去写代码。。
一般都是application.xml文件,放在idea的resource目录下,是一个bean注册的配置文件 内容如下: ```xml <?xml version="1.0" encoding="UTF-8"?> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"...
Praise for the Third Edition of Spring in Action Preface Acknowledgments About this Book 1. Core Spring Chapter 1. Springing into action 1.1. Simplifying Java development 1.1.1. Unleashing the power ...
spring application-context xml说明
放到resources下即可, 如果不生效则在application.yml文件中加 logging: config: file:config/logback-spring.xml
spring配置,关于做springMVC+ibatis整合的时候主义的问题。
Starting with the architecture of the Spring Framework and setting up the key components of the Spring application development environment, you will learn the configuration of Spring Container and how...
引用mybatis jar包、创建使用的配置文件spring-application.xml、创建公共基础调用类baseDao对象、集成使用。Redis作为日常系统中一个重要的缓存库,在一些固定数据保存、短信验证码保存,以及一些系统交互及session...
application.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:p=...
配置SSH框架是有关Spring的文件配置