名稱空間支援
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 Batch Integration 的 Spring XML 應用上下文檔案
<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 檔案後附加版本號。然而,由於無版本宣告始終使用最新的 Schema,我們通常不建議在 XSD 名稱後附加版本號。新增版本號可能會在更新 Spring Batch Integration 依賴項時產生問題,因為它們可能需要更新版本的 XML Schema。
batch-integration XML 名稱空間自 Spring Batch 6.0 起已棄用,並將在 7.0 版本中移除。 |