Creating lazily initialized Spring beans using annotation-based configuration

I am using Spring annotation @Componentto configure many of the beans in my Spring 3.0 application. I would like to know if it's possible to create some of these beans lazily - especially prototypebeans?

+5
source share
2 answers

To declare a lazy initialized bean, you can use annotation @Lazy.

Note, however, that this does not make sense for prototypebeans - they cannot be impatiently initialized, so there is no need to mark them lazy.

+12

beans . beans , - , .

+3

All Articles