<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="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-4.2.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-4.1.xsd">
和
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:security="http://www.springframework.org/schema/security"
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
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security.xsd">
在前者的区别,安全配置为
<http auto-config="true">
<intercept-url pattern="/login" access="permitAll()" />
</http>
而在后者将被配置为
<security:http auto-config="true">
<security:intercept-url pattern="/login" access="permitAll()" />
</security:http>
我不确定这两种模式格式之间的功能差异。也有人可以建议哪些是可喜的或哪些情况下哪些更可取?
请参见[XML名称空间](http://www.w3schools.com/xml/xml_namespaces.asp)。在你的第一个片段中,* security *命名空间很可能被用作基本命名空间。在后面的* beans *名称空间被用作基名称空间 –
谢谢,这是一个有用的指针。 – Jake