今天配置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/