spring注解@Import和@ImportResource

@Import只负责引入javaCOnfig形式定义的Ioc容器配置,等同于<import resource="xxx.xml"/>将一个配置文件导入另一个

@Configuration
@Import(CDPlayerConfig.class)  
@ImportResource("classpath:cons-injec.xml") //导入xml配置项
public class SoundSystemConfig {
 

@ImportResource负责引入xml配置

@ImportResource("classpath:cons-injec.xml") //导入xml配置项

 

posted on 2019-09-29 10:31  木西-Muxy  阅读(1799)  评论(0编辑  收藏  举报

导航