In our spring configuration, we put the beans tag as follows:
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
Now spring should find out from my calsspath the location of the spring-beans.xsd and spring-context.xsd files.
I found several xsd files along this path:
spring -context-4.1.5.RELEASE.jar / org / springframework / context / configuration
spring-context-2.5.xsd spring-context-3.0.xsd spring-context-3.1.xsd spring-context-3.2.xsd spring-context-4.0.xsd spring-context-4.1.xsd
When searching for spring - beans.xsd file, I found several files along this path:
spring - beans -4.1.5.RELEASE.jar / org / springframework / beans / factory / XML
spring-beans-2.5.xsd spring-beans-3.0.xsd spring-beans-3.1.xsd spring-beans-3.2.xsd spring-beans-4.0.xsd spring-beans-4.1.xsd
How spring will know where to look for this file, since there is no connection between the location of the schema in the beans tag and the actual location of this file. I can also find files like this spring-beans-<version>.xsd , while spring will know what spring-beans.xsd , even if we donβt specify any version in the <beans> .
java spring xml xsd
user3181365
source share