加载模式映射中的旧版Spring Framework模式

时间:2015-10-22 19:17:52

标签: java spring

在我正在回顾的基于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.schemasspring.handlers文件不会减少此映射集。

Spring在运行时具有遗留映射是否正常?

1 个答案:

答案 0 :(得分:1)

是;这很正常。每个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以找到答案之后,只需分享。