簡體   English   中英

在基於Java的配置中進行Spring導入

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM