Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
基于java的配置中的Spring导入_Java_Spring_Configuration - Fatal编程技术网

基于java的配置中的Spring导入

基于java的配置中的Spring导入,java,spring,configuration,Java,Spring,Configuration,也许我把这个问题的措辞弄错了。我的意思是,我想加载类路径中可用的所有java配置文件,而不是applicationContext.xml。像这样的- @Configuration @ImportResource("Some other configuration java files which might be in the dependant projects but in the same classpath") public class AppConfig { } 尝试使用@Im

也许我把这个问题的措辞弄错了。我的意思是,我想加载类路径中可用的所有java配置文件,而不是applicationContext.xml。像这样的-

@Configuration
@ImportResource("Some other configuration java files which might be in the dependant projects but in the same classpath")  
public class AppConfig {

}

尝试使用
@ImportResource
注释以基于java的配置导入xml配置

@Configuration  
@ImportResource("classpath*:beancontext/applicationContext.xml")  
public class AppConfig {

}  

@ImportResource
。谢谢你的回复。也许我把这个问题的措辞弄错了