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
})
相关推荐
Justin3go5 小时前
HUNT0 上线了——尽早发布,尽早发现
前端·后端·程序员
Tony Bai5 小时前
高并发后端:坚守 Go,还是拥抱 Rust?
开发语言·后端·golang·rust
没有bug.的程序员6 小时前
服务安全:内部服务如何防止“裸奔”?
java·网络安全·云原生安全·服务安全·零信任架构·微服务安全·内部鉴权
一线大码6 小时前
SpringBoot 3 和 4 的版本新特性和升级要点
java·spring boot·后端
weixin_440730506 小时前
java数组整理笔记
java·开发语言·笔记
weixin_425023006 小时前
Spring Boot 配置文件优先级详解
spring boot·后端·python
weixin_425023006 小时前
Spring Boot 实用核心技巧汇总:日期格式化、线程管控、MCP服务、AOP进阶等
java·spring boot·后端
一线大码6 小时前
Java 8-25 各个版本新特性总结
java·后端
2501_906150567 小时前
私有部署问卷系统操作实战记录-DWSurvey
java·运维·服务器·spring·开源
better_liang7 小时前
每日Java面试场景题知识点之-TCP/IP协议栈与Socket编程
java·tcp/ip·计算机网络·网络编程·socket·面试题