Spring @Bean with @Lookup method

前端 未结 1 462
遇见更好的自我
遇见更好的自我 2021-01-23 08:11

I\'ve implemented a Spring bean utilizing the @Lookup annotation. (This thread was helpful: How to use spring @Lookup annotation?)

I\'ve subsequently noticed a strange b

相关标签:
1条回答
  • 2021-01-23 08:35

    In fact this behavior is a limitation of the @Lookup annotation. The latest version of Spring documentation describes the caveat more explicitly than it did back in version 4.1.

    ...please remember that lookup methods won't work on beans returned from @Bean methods in configuration classes;

    In general, objects returned from @Bean methods do have their annotations processed; @Lookup is an exception to the typical behavior.

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