springboot常见注解

一、@SpringBootApplication:

1、介绍:这是一个组合注解:包含了

复制代码
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan(
    excludeFilters = {@Filter(
    type = FilterType.CUSTOM,
    classes = {TypeExcludeFilter.class}
), @Filter(
    type = FilterType.CUSTOM,
    classes = {AutoConfigurationExcludeFilter.class}
)}
)

SpringBootApplication注解等价于以默认属性使用@Configuration、@EnableAutoConfiguration和@ComponentScan。

2、禁用自动装配项:

复制代码
@SpringBootApplication(exclude = {
		DataSourceAutoConfiguration.class,
		SecurityAutoConfiguration.class
})
相关推荐
码云数智-园园10 分钟前
C++ STL 容器怎么选?vector、list、map、unordered_map 优缺点对比
java·开发语言
南雨北斗16 分钟前
Tp6 + Nginx 配置文件上传目录为public同级目录(宝塔面板)
后端
en.en..17 分钟前
竖线 |:管道、按位或、掩码组合
java·开发语言
techdashen29 分钟前
Go Map 详解:键值对实际上是如何存储的
开发语言·后端·golang
云上小朱30 分钟前
部署安全的pg数据库,搭配pgadmin实现web界面管理
后端
行百里er30 分钟前
HandlerInterceptor 和 WebFilter:两套 HTTP 请求拦截
后端·架构·监控
爱勇宝1 小时前
初创公司的“自己人”,到底能当多久?
前端·后端·程序员
掘金者阿豪1 小时前
Mac mini Intel 报错 DNS_PROBE_FINISHED_BAD_CONFIG 完整排障指南
后端
程序猿乐锅1 小时前
【计算机组成原理 | 第六章】中央处理器 CPU
java·开发语言
大模型丫丫1 小时前
如何提升单体 Spring Boot 应用的并发数?
java·spring boot·后端