spring 4.0 不再支持ref local標籤

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章