Spring XML equivalent of @Primary

前端 未结 1 940
耶瑟儿~
耶瑟儿~ 2021-01-18 04:28

Is there an XML equivalent of @Primary that can promote one of the multiple qualifying beans

Example Scenario:

I\'ve a spr

相关标签:
1条回答
  • 2021-01-18 05:06

    <bean> property has primary attribute:

    <bean primary="true|false"/>
    

    And remember:

    If a @Primary-annotated class is declared via XML, @Primary annotation metadata is ignored, and <bean primary="true|false"/> is respected instead.

    0 讨论(0)
提交回复
热议问题