Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring config files and specifying schema versions

Tags:

spring

Seems you can not specify the version numbers in the spring config files:

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

So is Spring going to the latest version in the classpath? Where is this in spring docs if listed at all?

like image 580
arinte Avatar asked Feb 08 '12 16:02

arinte


2 Answers

There is a spring.schemas file in spring-beans.jar. This file contains pointers to the XSD files. Here is the value in the spring.schemas file.

http\://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-3.1.xsd

Therefore, the file is in the package org.springframework.beans.factory.xml of the jar.

like image 96
Simon LG Avatar answered Oct 18 '22 12:10

Simon LG


You absolutely can specify the version: http://www.springframework.org/schema/beans/

Click the link, it lists all the available versioned XSDs.

However, the unversioned XSD always points to the latest version.

like image 3
Spencer Kormos Avatar answered Oct 18 '22 12:10

Spencer Kormos