![f21322e8a4b0dc4833b3f3a819811887.png](https://img-blog.csdnimg.cn/img_convert/f21322e8a4b0dc4833b3f3a819811887.png)
在本文中,我们将讨论 Spring boot 中最常见的10个面试问题。现在,在就业市场上,这些问题有点棘手,而且趋势日益严重。
![53eb6edcdd89c68ae1fe615f509a14f6.png](https://img-blog.csdnimg.cn/img_convert/53eb6edcdd89c68ae1fe615f509a14f6.png)
1. @SpringBootApplication 是做什么的?
根据 Spring Boot 文档, @SpringBootApplication 注解相当于使用 @Configuration 、@EnableAutoConfiguration 和 @ComponentScan 及其默认属性。Spring Boot 允许开发人员使用单个注解而不是多个注解。但是,正如我们所知,Spring 提供了松散耦合的特性,我们可以根据项目的需要单独使用每个注解。2. 如何在不使用 basePackages 过滤器的情况下排除任何包?
您可以通过不同方式过滤任意的包。但是,在不接触组件扫描的情况下,Spring Boot 为实现这个提供了一个复杂的选项。当您使用注解 @SpringApplication 时,可以使用 exclude 属性。请参考以下代码片段:
&#