@Configuration
Configuration用于定义配置类,标注在类上。
@Component
@controller、@servic、@Mapper其实都是@Component。
区别:
@Component所有类都可以注解,但是@Configuration注解类里面有@Value注解的成员变量和@Bean注解的方法。
@Configuration
Configuration用于定义配置类,标注在类上。
@Component
@controller、@servic、@Mapper其实都是@Component。
区别:
@Component所有类都可以注解,但是@Configuration注解类里面有@Value注解的成员变量和@Bean注解的方法。