配置文件:
<?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>
原文地址:https://www.cnblogs.com/liuyang-520/p/12335070.html
时间: 2024-10-19 00:35:31