Spring-boot自动导入applicationContext.xml? [英] Spring-boot automatically import applicationContext.xml?

查看:700
本文介绍了Spring-boot自动导入applicationContext.xml?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 spring-boot 并希望自动导入 src / main / resources / applicationContext.xml file。

I'm using spring-boot and would like to automatically import src/main/resources/applicationContext.xml file.

到目前为止它只有在我明确告诉spring导入它时才有效:

So far it only works if I explicit tell spring to import it:

@EnableAutoConfiguration
@Configuration
@ImportResource({"classpath*:applicationContext.xml"})

但是spring-boot有很多默认值,也许有人知道app.xml文件的默认名称,所以默认情况下会被spring-boot选中?

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?

推荐答案

默认情况下,根据其名称或位置导入XML配置没有此功能。

There is no such feature for importing an XML configuration by default based on it's name or location.

查看这个部分文档。

这篇关于Spring-boot自动导入applicationContext.xml?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆