I have a rest controller like this :
@Slf4j
@RestController
@RequestMapping(...)
public class MyController {
private MyService service;
public MyController(MyService service){
this.service = service;
}
And the service class is a component :
@Component
public class MyService{
...
}
And when I run the program, the service
field is correctly injected. But how is it injected (there is no autowired annotation neither on filed ni on constructor) ?.
I am using SpringBoot 2.0.