In our spring configuration we put the beans tag like this:
<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 has to find out from my calsspath for the location of the files spring-beans.xsd
& spring-context.xsd
.
I have found some xsd files at this path:
spring-context-4.1.5.RELEASE.jar/org/springframework/context/config
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 it some files in 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 as there is no link between the schema location in my beans
tag and the actual location of this file. Also I am able to find out files like this spring-beans-<version>.xsd
then how spring will know what is spring-beans.xsd
even when we do not specify any version in <beans>
tag.