<?xml version="1.0" encoding="UTF-8"?>
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
xmlns:context="http://www.springframework.org/schema/context"
|
xmlns:redis="http://www.springframework.org/schema/redis"
|
xmlns:cache="http://www.springframework.org/schema/cache"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
|
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/aop
|
http://www.springframework.org/schema/aop/spring-aop.xsd
|
http://www.springframework.org/schema/redis
|
http://www.springframework.org/schema/redis/spring-redis.xsd
|
http://www.springframework.org/schema/cache
|
http://www.springframework.org/schema/cache/spring-cache.xsd
|
">
|
|
<!-- 引入属性文件 -->
|
<context:property-placeholder location="classpath:config.properties" />
|
|
<!-- 自动扫描(自动注入) -->
|
<!-- 扫描service -->
|
<context:component-scan base-package="
|
com.shlanbao.tzsc.base.dao,
|
com.shlanbao.tzsc.*.service,
|
com.shlanbao.tzsc.*.*.service,
|
com.shlanbao.tzsc.*.*.*.service,
|
com.shlanbao.tzsc.data.runtime.handler" />
|
<!-- redis config -->
|
<import resource="classpath:spring-redis.xml" />
|
|
<!-- 1.开启注解AOP -->
|
<aop:aspectj-autoproxy></aop:aspectj-autoproxy>
|
|
<!-- 6.开启注解AOP (前提是引入aop命名空间和相关jar包) -->
|
<aop:aspectj-autoproxy expose-proxy="true" proxy-target-class="true"></aop:aspectj-autoproxy>
|
|
<!-- 7.开启aop,对类代理强制使用cglib代理 -->
|
<aop:config proxy-target-class="true"></aop:config>
|
|
<!-- 8.扫描 @Service @Component 注解-->
|
<context:component-scan base-package="com.shlanbao.tzsc" >
|
<!-- 不扫描 @Controller的类 -->
|
<context:exclude-filter type="annotation"
|
expression="org.springframework.stereotype.Controller" />
|
</context:component-scan>
|
|
</beans>
|