在我正在审查的基于SpringFramework3.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
只使用Spring3.2定义创建自己的spring.schemas
和spring.handlers
文件并不会减少这个映射集。
Spring在运行时拥有遗留映射是正常的吗?
发布于 2015-10-22 19:17:51
是的,这很正常。每个Spring,例如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来找到答案。
https://stackoverflow.com/questions/33288951
复制相似问题