配置扫描注解的包

配置文件:

<?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">
    <!--配置扫描注解的包,会自动扫描包及其所有子包下的注解-->
    <context:component-scan base-package="com.ly.spring"></context:component-scan>
</beans>

 

posted @ 2020-02-20 12:00  牛牛的自留地  阅读(654)  评论(0编辑  收藏  举报