Answer the question
In order to leave comments, you need to log in
How to forward request data (request beans) to services (singleton beans)?
Hello! New to spring.
A request comes to me, a request bean is created with some data.
There is a bean for accessing a third-party API (singleton), and in its methods I need to get the request bean.
Of course, I can pass it as an argument to the singleton bean method, but for this I have to pass it from the controller through a bunch of layers. Is there any easier method?
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
Not only easier, but also more correct - to inject one bean into another. All Spring is around DI and built.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question