跳到主要内容
版本:6.0.2

命名空间支持

DeepSeek V3 中英对照 Namespace Support

Spring Batch Integration 在 1.3 版本中增加了专用的 XML 命名空间支持,旨在提供更便捷的配置体验。要使用该命名空间,请将以下命名空间声明添加到你的 Spring XML 应用上下文文件中:

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:batch-int="http://www.springframework.org/schema/batch-integration"
xsi:schemaLocation="
http://www.springframework.org/schema/batch-integration
https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd">

...

</beans>

以下示例展示了一个完全配置的 Spring XML 应用上下文文件,适用于 Spring Batch Integration:

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:batch="http://www.springframework.org/schema/batch"
xmlns:batch-int="http://www.springframework.org/schema/batch-integration"
xsi:schemaLocation="
http://www.springframework.org/schema/batch-integration
https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd
http://www.springframework.org/schema/batch
https://www.springframework.org/schema/batch/spring-batch.xsd
http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration
https://www.springframework.org/schema/integration/spring-integration.xsd">

...

</beans>

在引用的 XSD 文件中附加版本号也是允许的。然而,由于无版本声明始终使用最新的模式,我们通常不建议在 XSD 名称后附加版本号。添加版本号可能会在更新 Spring Batch Integration 依赖项时引发问题,因为它们可能需要更新版本的 XML 模式。

注意

自 Spring Batch 6.0 起,batch-integration XML 命名空间已被弃用,并将在版本 7.0 中移除。