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
})
相关推荐
直奔標竿1 分钟前
Java开发者AI转型第十三课!知识库终局方案:Spring AI Vector Store架构演进与ETL全链路入库实战
java·人工智能·后端·spring
XiYang-DING3 分钟前
【Java EE】阻塞队列(BlockingQueue)
java·java-ee
aLTttY9 分钟前
Spring Boot 3.x 集成 AI 大模型实战指南
人工智能·spring boot·后端
AndreasEmil9 分钟前
基于多设计模式的抽奖系统 - 测试报告
java·selenium·设计模式·postman
星轨zb14 分钟前
什么是Spring设计模式:单例、工厂与代理
java·spring·设计模式
Seven9716 分钟前
Tomcat Server的设计和实现:StandardServer
java
s65166549617 分钟前
Makefile语法学习
java·linux·前端
Rabitebla17 分钟前
二分查找(含有动画展示):不再写出死循环
java·开发语言
ejinxian19 分钟前
Rust Web框架三巨头Actix-web、Axum 、Rocket
开发语言·后端·rust
人道领域21 分钟前
【LeetCode刷题日记】150.逆波兰表达式求值
java·数据结构·算法·leetcode