我是Spring Boot Application的新手.我想了解spring Boot Application如何在没有@Configuration类的情况下创建bean.我看了一个示例项目,其中既没有@Bean定义也没有组件扫描,但@Autowired提供了对类的依赖.请看下面的代码:
@RestController
public class RestController{
**@Autowired
public CertificationService certificationService;**
.
.
.
.
}
//Interface
public interface CertificationService{
public List<Certification> findAll();
}
//Implementation Class
@Transactional
@Service
public class CertificationServiceImpl{
public List<Certification> findAll(){
.
.
}
}
Run Code Online (Sandbox Code Playgroud)
我对spring的有限知识告诉我,当一个类上有@Service注释时,必须有一个@ComponentScan来创建bean.但是没有组件扫描,如何创建CertificationServiceImpl bean,以及RestController中的CertificationService自动装配如何在这里工作?