M
M
mitaichik2017-05-01 13:47:32
Spring
mitaichik, 2017-05-01 13:47:32

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

1 answer(s)
S
Sergey Gornostaev, 2017-05-01
@mitaichik

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 question

Ask a Question

731 491 924 answers to any question