配置applicationContext-service.xml 03

本节操作完成了对spring父容器中service层扫描加载的配置。

1、在resources中创建applicationContext-service.xml

具体操作如下图所示:

创建applicationContext-service.xml

2、修改applicationContext-service.xml

<?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"
       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">
    <!--扫描controller层-->
    <context:component-scan base-package="net.wanho.service"></context:component-scan>
</beans>

至此,我们完成了对spring父容器中service扫描加载的配置。

猜你喜欢

转载自www.cnblogs.com/alichengxuyuan/p/12581681.html
03