在配置类尚标注此注解,等同于spring配置文件中的

<import resource="beans.xml"/>

 

Spring Boot里面没有Spring的配置文件,我们自己编写的配置文件,也不能自动识别;

想让Spring的配置文件生效,加载进来;@ImportResource标注在一个配置类上

@ImportResource(locations = {"classpath:beans.xml"})

 

相关文章:

  • 2022-12-23
  • 2021-08-11
  • 2021-11-08
  • 2021-11-22
  • 2021-04-21
  • 2021-10-29
  • 2021-05-29
  • 2021-11-08
猜你喜欢
  • 2021-10-26
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2021-11-24
  • 2022-12-23
  • 2021-08-17
相关资源
相似解决方案