This does not apply to Spring, but refers more to XML and namespaces - here's the link: http://www.w3schools.com/xml/xml_namespaces.asp , http://en.wikipedia.org/wiki/XML_namespace
Just to summarize: In the first case
<beans xmlns="http://www.springframework.org/schema/beans"
makes the beans schema the default for this xml file, which allows you to refer to elements in this beans schema without a namespace prefix. So, where is this schema defined - a reference to the schema is usually included in the schemaLocations attribute like this:
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"
What is said above is that the definition of http://www.springframework.org/schema/beans is present in the corresponding .xsd file
In your second instance -
<beans:beans xmlns="http://www.springframework.org/schema/mvc" xmlns:beans="http://www.springframework.org/schema/beans"
Now you define the mvc namespace as the default namespace, so in this case, any elements in the mvc scheme can be referenced without a prefix, but if you want to refer to any elements of the beans scheme, you will have to refer to it using the beans: prefix, as for beans:import in your example
source share