Skip to main content
 首页 » 编程设计

python之Spring python : how to import another xml resource from within an xml config file

2025年05月04日17Leo_wl

在 Java spring 中,可以将配置分成多个 xml 文件,然后使用一个从另一个导入

<import resource="importedConfig.xml"/> 

如何在 SpringPython 中做同样的事情?

请您参考如下方法:

虽然似乎没有包含其他资源的选项,但您可以使用多个配置文件初始化 Spring Python:

configs = [ XMLConfig("config-1.xml"), XMLConfig("config-2.xml") ] 
container = ApplicationContext( configs ) 

(参见 spring-python source )