@ImportResource 导入Spring 的xml配置文件时间:2023-03-10 00:31:53 在配置类尚标注此注解,等同于spring配置文件中的 <import resource="beans.xml"/> Spring Boot里面没有Spring的配置文件,我们自己编写的配置文件,也不能自动识别; 想让Spring的配置文件生效,加载进来;@ImportResource标注在一个配置类上 @ImportResource(locations = {"classpath:beans.xml"})