Creating lazily initialized Spring beans using annotation based configuration

前端 未结 2 495
天涯浪人
天涯浪人 2021-01-05 19:35

I am using Spring\'s @Component annotation to configure many of the beans in my Spring 3.0 application. I would like to know if it\'s possible to construct some

2条回答
  •  无人及你
    2021-01-05 19:55

    Lazy initialization isn't an option in the context of prototype-scoped beans. Those beans are instantiated and initialized on demand every time something asks for them, so they are, by nature, lazily initialized.

提交回复
热议问题