找到以元素'global-method-security'开头的无效内容

use*_*358 3 java spring spring-security

在下面的代码我得到一个像这样的错误"cvc-complex-type.2.4.a:从元素'global-method-security'开始发现了无效的内容.其中一个'{" http://www.springframework. org/schema/beans ":import," http://www.springframework.org/schema/ beans":别名," http://www.springframework.org/schema/beans ":bean,WC [## other : "HTTP:// www.springframework.org/schema/beans"]," http://www.springframework.org/schema/beans ":豆}"预期".

怎么修好呢?

 <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:security="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
    http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">



<context:component-scan base-package="client.security"/>

<global-method-security secured-annotations="enabled" />


</beans>
Run Code Online (Sandbox Code Playgroud)

lok*_*ath 6

更换

"<global-method-security secured-annotations="enabled" />" line with 

     <security:global-method-security secured-annotations="enabled"/>
Run Code Online (Sandbox Code Playgroud)

它应该工作..