1. @Bean: 1.1 定义 从定义可以看出,@Bean只能用于注解方法和注解的定义. @Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE}) @Retention(RetentionPolicy.RUNTIME) 1.2 spring文档中对 @Bean的说明 The @Bean annotation is used to indicate that a method instantiates, configures and i…