@Bean註解
@Bean註解等價於配置文件中的<bean>標籤,對應的參數也是將短橫線命名切換爲駝峯命名——<bean init-method="..."> => @Bean(initMethod="...")。
@Bean註解只能使用在方法上,方法必須是在@Configuration標記的類或者其他Bean中。
Bean 四種方式:1@Component 2<Bean/> xml 3.@Configuration @Bean
4AnnotationConfigApplicationContext 直接添加 5 @Import