今天配置bean时顺手写了
<ref local="xxxxx">
结果报错,attribute local is not allowed here
感到很奇怪,看了一下,spring 4.0不再支持 ref local 了。
如果想继续使用的话将xsd 指向 3.2,
xsi:schemaLocation=”http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd“>
当然官方推荐 使用
<ref bean="xxxxx">
The local attribute on the ref element is no longer supported in the 4.0 beans xsd since it does not provide value over a regular bean reference anymore. Simply change your existing ref local references to ref bean when upgrading to the 4.0 schema.
地址:http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/