<?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"
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"
default-autowire="byName">
<!-- @author ForeignStudent @version 2017/9/20 -->
<!-- 引用外部屬性檔案 -->
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:applicationContext/spring.properties</value>
</list>
</property>
</bean>
<!-- 掃描服務層 -->
<context:component-scan base-package="com.conferencerooms.service" />
<!-- aspectj aop啟用CGliB代理 -->
<aop:aspectj-autoproxy expose-proxy="true" proxy-target-class="true" />
<import resource="classpath:applicationContext/spring-mybatis.xml" />
<import resource="classpath:applicationContext/spring-shiro.xml" />
<import resource="classpath:applicationContext/spring-ehcache.xml" />
</beans>
這裡隻掃描服務層,其他都在對應的層掃描。
轉載于:https://www.cnblogs.com/foreign-student/p/7593955.html