[英]Spring import in java based 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 {
}
嘗試使用@ImportResource
批注在基於Java的配置中導入xml配置
@Configuration
@ImportResource("classpath*:beancontext/applicationContext.xml")
public class AppConfig {
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.