Spring application context is available inside the constructor

I am having a problem when trying to create beans from the context of a spring application inside a bean created using spring using constructor arguments.

I have implemented an interface ApplicationContextAware, but it fills the context after creating the instance (obviously).

But then, if you need to get beans from the constructor, and I'm talking about a variable number of objects defined at runtime, what would be the correct way?

+5
source share
2 answers

beans, Spring, , "init-method" Spring.

, , Spring.

+5

, - . Spring - @Configurable (preConstruction = true).

Spring - 6.8.1. AspectJ Spring

+3

All Articles