@configuration和@component之间的区别是:@Component注解的范围最广,所有类都可以注解,但是@Configuration注解一般注解在这样的类上:这个类里面有@Value注解的成员变量和@Bean注解的方法,就是一个配置类。

@component多例的,@configuration是单例的

相关文章:

  • 2022-12-23
  • 2023-04-07
  • 2023-03-06
  • 2021-09-03
  • 2023-04-07
  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-12
  • 2021-06-11
  • 2022-12-23
  • 2022-03-05
  • 2022-12-23
  • 2021-07-22
相关资源
相似解决方案