Spring安全应用程序的spring-servlet.xml的bean组件需要xmlns

时间:2012-02-19 13:36:56

标签: xml spring spring-security

如何确定Spring-servlet.xml(spring配置文件)的beans组件对于spring安全应用程序需要什么xmlns?

这是正确的代码吗?

<?xml version="1.0" encoding="UTF-8"?>
<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-2.5.xsd
       http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">

...

</beans>

1 个答案:

答案 0 :(得分:0)

我在spring框架参考中得到了我的答案,并在下面提到:

<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-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.0.3.xsd">
...
</beans>

一般情况下应该是这样的。供参考Spring Security 3.0 Reference