在我正在审查的基于 Spring Framework 3.2 的应用程序中,我注意到 Spring 的 PluggableSchemaResolver
在运行时生成一个映射,其中包括许多旧的 Spring 架构。为了清楚起见缩写:
w.sf.o/s/ means www.springframwork.org/schemas/
和
o/sf/ means org.springframework
这里是完整列表:
http://w.sf.o/s/aop/spring-aop-2.0.xsd o/sf/aop/config/spring-aop-2.0.xsd
http://w.sf.o/s/aop/spring-aop-2.5.xsd o/sf/aop/config/spring-aop-2.5.xsd
http://w.sf.o/s/aop/spring-aop-3.0.xsd o/sf/aop/config/spring-aop-3.0.xsd
http://w.sf.o/s/aop/spring-aop-3.1.xsd o/sf/aop/config/spring-aop-3.1.xsd
http://w.sf.o/s/aop/spring-aop-3.2.xsd o/sf/aop/config/spring-aop-3.2.xsd
http://w.sf.o/s/aop/spring-aop.xsd o/sf/aop/config/spring-aop-3.2.xsd
http://w.sf.o/s/beans/spring-beans-2.0.xsd o/sf/beans/factory/xml/spring-beans-2.0.xsd
http://w.sf.o/s/beans/spring-beans-2.5.xsd o/sf/beans/factory/xml/spring-beans-2.5.xsd
http://w.sf.o/s/beans/spring-beans-3.0.xsd o/sf/beans/factory/xml/spring-beans-3.0.xsd
http://w.sf.o/s/beans/spring-beans-3.1.xsd o/sf/beans/factory/xml/spring-beans-3.1.xsd
http://w.sf.o/s/beans/spring-beans-3.2.xsd o/sf/beans/factory/xml/spring-beans-3.2.xsd
http://w.sf.o/s/beans/spring-beans.xsd o/sf/beans/factory/xml/spring-beans-3.2.xsd
http://w.sf.o/s/cache/spring-cache-3.1.xsd o/sf/cache/config/spring-cache-3.1.xsd
http://w.sf.o/s/cache/spring-cache-3.2.xsd o/sf/cache/config/spring-cache-3.2.xsd
http://w.sf.o/s/cache/spring-cache.xsd o/sf/cache/config/spring-cache-3.2.xsd
http://w.sf.o/s/context/spring-context-2.5.xsd o/sf/context/config/spring-context-2.5.xsd
http://w.sf.o/s/context/spring-context-3.0.xsd o/sf/context/config/spring-context-3.0.xsd
http://w.sf.o/s/context/spring-context-3.1.xsd o/sf/context/config/spring-context-3.1.xsd
http://w.sf.o/s/context/spring-context-3.2.xsd o/sf/context/config/spring-context-3.2.xsd
http://w.sf.o/s/context/spring-context.xsd o/sf/context/config/spring-context-3.2.xsd
http://w.sf.o/s/jdbc/spring-jdbc-3.0.xsd o/sf/jdbc/config/spring-jdbc-3.0.xsd
http://w.sf.o/s/jdbc/spring-jdbc-3.1.xsd o/sf/jdbc/config/spring-jdbc-3.1.xsd
http://w.sf.o/s/jdbc/spring-jdbc-3.2.xsd o/sf/jdbc/config/spring-jdbc-3.2.xsd
http://w.sf.o/s/jdbc/spring-jdbc.xsd o/sf/jdbc/config/spring-jdbc-3.2.xsd
http://w.sf.o/s/jee/spring-jee-2.0.xsd o/sf/ejb/config/spring-jee-2.0.xsd
http://w.sf.o/s/jee/spring-jee-2.5.xsd o/sf/ejb/config/spring-jee-2.5.xsd
http://w.sf.o/s/jee/spring-jee-3.0.xsd o/sf/ejb/config/spring-jee-3.0.xsd
http://w.sf.o/s/jee/spring-jee-3.1.xsd o/sf/ejb/config/spring-jee-3.1.xsd
http://w.sf.o/s/jee/spring-jee-3.2.xsd o/sf/ejb/config/spring-jee-3.2.xsd
http://w.sf.o/s/jee/spring-jee.xsd o/sf/ejb/config/spring-jee-3.2.xsd
http://w.sf.o/s/lang/spring-lang-2.0.xsd o/sf/scripting/config/spring-lang-2.0.xsd
http://w.sf.o/s/lang/spring-lang-2.5.xsd o/sf/scripting/config/spring-lang-2.5.xsd
http://w.sf.o/s/lang/spring-lang-3.0.xsd o/sf/scripting/config/spring-lang-3.0.xsd
http://w.sf.o/s/lang/spring-lang-3.1.xsd o/sf/scripting/config/spring-lang-3.1.xsd
http://w.sf.o/s/lang/spring-lang-3.2.xsd o/sf/scripting/config/spring-lang-3.2.xsd
http://w.sf.o/s/lang/spring-lang.xsd o/sf/scripting/config/spring-lang-3.2.xsd
http://w.sf.o/s/mvc/spring-mvc-3.0.xsd o/sf/web/servlet/config/spring-mvc-3.0.xsd
http://w.sf.o/s/mvc/spring-mvc-3.1.xsd o/sf/web/servlet/config/spring-mvc-3.1.xsd
http://w.sf.o/s/mvc/spring-mvc-3.2.xsd o/sf/web/servlet/config/spring-mvc-3.2.xsd
http://w.sf.o/s/mvc/spring-mvc.xsd o/sf/web/servlet/config/spring-mvc-3.2.xsd
http://w.sf.o/s/task/spring-task-3.0.xsd o/sf/scheduling/config/spring-task-3.0.xsd
http://w.sf.o/s/task/spring-task-3.1.xsd o/sf/scheduling/config/spring-task-3.1.xsd
http://w.sf.o/s/task/spring-task-3.2.xsd o/sf/scheduling/config/spring-task-3.2.xsd
http://w.sf.o/s/task/spring-task.xsd o/sf/scheduling/config/spring-task-3.2.xsd
http://w.sf.o/s/tool/spring-tool-2.0.xsd o/sf/beans/factory/xml/spring-tool-2.0.xsd
http://w.sf.o/s/tool/spring-tool-2.5.xsd o/sf/beans/factory/xml/spring-tool-2.5.xsd
http://w.sf.o/s/tool/spring-tool-3.0.xsd o/sf/beans/factory/xml/spring-tool-3.0.xsd
http://w.sf.o/s/tool/spring-tool-3.1.xsd o/sf/beans/factory/xml/spring-tool-3.1.xsd
http://w.sf.o/s/tool/spring-tool-3.2.xsd o/sf/beans/factory/xml/spring-tool-3.2.xsd
http://w.sf.o/s/tool/spring-tool.xsd o/sf/beans/factory/xml/spring-tool-3.2.xsd
http://w.sf.o/s/tx/spring-tx-2.0.xsd o/sf/transaction/config/spring-tx-2.0.xsd
http://w.sf.o/s/tx/spring-tx-2.5.xsd o/sf/transaction/config/spring-tx-2.5.xsd
http://w.sf.o/s/tx/spring-tx-3.0.xsd o/sf/transaction/config/spring-tx-3.0.xsd
http://w.sf.o/s/tx/spring-tx-3.1.xsd o/sf/transaction/config/spring-tx-3.1.xsd
http://w.sf.o/s/tx/spring-tx-3.2.xsd o/sf/transaction/config/spring-tx-3.2.xsd
http://w.sf.o/s/tx/spring-tx.xsd o/sf/transaction/config/spring-tx-3.2.xsd
http://w.sf.o/s/util/spring-util-2.0.xsd o/sf/beans/factory/xml/spring-util-2.0.xsd
http://w.sf.o/s/util/spring-util-2.5.xsd o/sf/beans/factory/xml/spring-util-2.5.xsd
http://w.sf.o/s/util/spring-util-3.0.xsd o/sf/beans/factory/xml/spring-util-3.0.xsd
http://w.sf.o/s/util/spring-util-3.1.xsd o/sf/beans/factory/xml/spring-util-3.1.xsd
http://w.sf.o/s/util/spring-util-3.2.xsd o/sf/beans/factory/xml/spring-util-3.2.xsd
http://w.sf.o/s/util/spring-util.xsd o/sf/beans/factory/xml/spring-util-3.2.xsd
仅使用 Spring 3.2 定义创建我自己的 spring.schemas
和 spring.handlers
文件不会减少此映射集。
Spring 在运行时拥有遗留映射是正常的吗?
最佳答案
是的;这是正常的。每个Spring JAR,例如spring-tx-3.2.14.RELEASE.jar
,都包含一个META-INF/spring.schemas
,其中包含所有支持的Spring版本的映射;在 spring-tx-3.2.jar 中,spring.schemas 包含:
http\://www.springframework.org/schema/tx/spring-tx-2.0.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd
http\://www.springframework.org/schema/tx/spring-tx-2.5.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd
http\://www.springframework.org/schema/tx/spring-tx-3.0.xsd=org/springframework/transaction/config/spring-tx-3.0.xsd
http\://www.springframework.org/schema/tx/spring-tx-3.1.xsd=org/springframework/transaction/config/spring-tx-3.1.xsd
http\://www.springframework.org/schema/tx/spring-tx-3.2.xsd=org/springframework/transaction/config/spring-tx-3.2.xsd
http\://www.springframework.org/schema/tx/spring-tx.xsd=org/springframework/transaction/config/spring-tx-3.2.xsd
只是在花时间思考并随后查看源代码和生成的 JAR 以找到答案后分享。
关于java - 加载模式映射中的旧版 Spring 框架模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33288951/