Spring Boot 注解

qq_79083 24 0 PDF 2021-02-01 18:02:46

一 、注解列表 @SpringBootApplication: 包含了@ComponentScan、@Configuration和@EnableAutoConfiguration注解。其中@ComponentScan让Spring Boot扫描到Configuration类并把它加入到程序上下文。 @Configuration: 等同于Spring的XML配置文件;使用Java代码可以检查类型安全。 @EnableAutoConfiguration: 自动配置。 @ComponentScan: 组件扫描,可自动发现和配置一些Bean。 @Component: 可配合CommandLineRu

用户评论
请输入评论内容
评分:
暂无评论