springpython:如何从xml配置文件中导入另一个xml资源

2024-06-16 12:36:45 发布

您现在位置:Python中文网/ 问答频道 /正文

在javaspring中,可以将配置划分为多个xml文件,然后使用

<import resource="importedConfig.xml"/>

如何在SpringPython中执行相同的操作?你知道吗


Tags: 文件importxmlresourcespringpythonjavaspringimportedconfig
1条回答
网友
1楼 · 发布于 2024-06-16 12:36:45

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

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

(见spring-python source

相关问题 更多 >