spring3.0报如何错误,是啥问题呢,超郁闷

Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'authentication-provider'. One of '{"http://www.springframework.org/schema/security":authentication-provider, "http://www.springframework.org/schema/security":ldap-authentication-provider}' is expected.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) [na:1.6.0_02]

xml文件如下:

<?xml version="1.0" encoding="UTF-8"?>
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.xsd"
default-lazy-init="true">

SpringSecurity安全配置

<!-- http安全配置 -->


default-target-url="/" authentication-failure-url="/security/login.action?error=1" />


error-if-maximum-exceeded="false" />
/s:session-management
/s:http







/s:authentication-manager

1个回答

[quote]
[code="java"]
Invalid content was found starting with element 'authentication-provider'.
[/code]
[/quote]
错误提示了。
[code="xml"]






[/code]
这个设置部分应该加上你声明的xml命名空间吧,就是“s:”

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!