Java Spring-boot 自动导入applicationContext.xml?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25687754/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Spring-boot automatically import applicationContext.xml?
提问by membersound
I'm using spring-boot
and would like to automatically import src/main/resources/applicationContext.xml
file.
我正在使用spring-boot
并希望自动导入src/main/resources/applicationContext.xml
文件。
So far it only works if I explicit tell spring to import it:
到目前为止,它只有在我明确告诉 spring 导入它时才有效:
@EnableAutoConfiguration
@Configuration
@ImportResource({"classpath*:applicationContext.xml"})
But spring-boot has so many default, maybe someone knows the "default" name for the app.xml file so that is gets picked up by spring-boot by default?
但是 spring-boot 有这么多默认值,也许有人知道 app.xml 文件的“默认”名称,以便 spring-boot 默认选择它?