未声明Spring安全http和身份验证提供程序
我试图将Spring安全性集成到我现有的项目中。我使用的工具有:未声明Spring安全http和身份验证提供程序,spring,spring-security,Spring,Spring Security,我试图将Spring安全性集成到我现有的项目中。我使用的工具有: 春季2.5.6.03 spring security core 3.1.1.1版本 jdk7 在spring配置中,我有以下内容: <beans:beans xmlns="http://springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://
<beans:beans xmlns="http://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-3.1.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">
<http auto-config='true'>
<intercept-url pattern="/messagePost.htm*" access="ROLE_USER"/>
</http>
<authentication-provider>
<user-service>
<user name="user1" password="1111" authorities="ROLE_USER"/>
</user-service>
</authentication-provider>
</beans:beans>
但此spring配置有一个错误:
<?xml version="1.0" encoding="UTF-8"?>
<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-3.1.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.1.xsd">
<http auto-config='true'>
<intercept-url pattern="/messagePost.htm*" access="ROLE_USER"/>
</http>
<authentication-manager>
<authentication-provider>
<user-service>
<user name="user1" password="1111" authorities="ROLE_USER"/>
</user-service>
</authentication-provider>
</authentication-manager>
</beans:beans>
我做了以下修改
更改您的xmlns架构http://springframework.org/schema/security“
至”http://www.springframework.org/schema/security“
(新增www:D)
名称空间括在
名称空间中<?xml version="1.0" encoding="UTF-8"?>
<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-3.1.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.1.xsd">
<http auto-config='true'>
<intercept-url pattern="/messagePost.htm*" access="ROLE_USER"/>
</http>
<authentication-manager>
<authentication-provider>
<user-service>
<user name="user1" password="1111" authorities="ROLE_USER"/>
</user-service>
</authentication-provider>
</authentication-manager>
</beans:beans>
我做了以下修改
更改您的xmlns架构http://springframework.org/schema/security“
至”http://www.springframework.org/schema/security“
(新增www:D)
名称空间括在
名称空间中我可以知道
是Spring3中的一项新功能吗?我还没有使用SpringSecurity<3。所以我不确定。您可以查看更多信息。我可以知道
是Spring3中的一项新功能吗?我没有使用SpringSecurity<3。所以我不确定。你可以查看更多关于这个的信息。