How to Dynamically Inject a Service in Spring Framework During Runtime
Let’s take an example & understand the problem first. We have one VehicleService interface: We have two different implementations of VehicleService: We have a RestController: So you got the problem. I need to use either TwoWheelerService or FourWheelerService based on the “type” query parameter in the Controller method. We can do that easily. We can … Read more