Do you know these SpringBoot interview questions?

Get technical dry goods and industry information for the first time!

Do you know these SpringBoot interview questions?

In the article posted yesterday, many netizens sent private messages, and they couldn't control themselves. They kept reading the vibrato for a long time. This reminds me of He Jiong’s words: “If you want to get you, you have to learn to give, to give and persevere; if you really find it difficult, then you give up, if you give up, don’t complain. Life is In this way, the world is balanced. Everyone decides what his life looks like through his own efforts. Only by working hard, persevering and paying, can you get the life you want. Either shake hands with your mediocrity, or just Let your efforts be worthy of your dreams."

Today, let me share with you some interview questions about SpringBoot.

Do you know these SpringBoot interview questions?
Where can the default location of the static homepage in SpringBoot be placed?

Answer: When we apply the root directory, we can directly map and put index.html in the following location:

Do you know these SpringBoot interview questions?

What is the priority of the direct mapping of static resources in SpringBoot?

Answer: SpringBoot static resources are directly mapped to /**, which can be accessed through the root directory. /META-INF/resources/webjars/ is mapped to /webjars/, which can be accessed by visiting /webjar. The order of priority is: META-INF/resources> resources> static> public.

Inheriting the WebMvcConfigurerAdapter abstract class, how many commonly used rewriting methods are listed?

Answer: WebMvcConfigurerAdapter implements the WebMvcConfigurer interface. Commonly used methods that may need to be rewritten are as follows:

Do you know these SpringBoot interview questions?

How to disable certain automatic configuration features in SpringBoot?

Answer: There are 3 methods. If we want to disable some automatic configuration features, we can use @EnableAutoConfiguration or @SpringBootApplication annotated exclude attribute to indicate.

Do you know these SpringBoot interview questions?

What are the 3 important annotations introduced by @SpringBootApplication?

Answer: @SpringBootConfiguration, @EnableAutoConfiguration, @ComponentScan. The other 4 @Target, @Retention, @Documented, and @Inherited are also important, but they should not be the knowledge points to be asked in this question.

Which annotations are the attributes in the @SpringBootApplication annotation equivalent to?

Answer: It is equivalent to using @Configuration, @EnableAutoConfiguration and @ComponentScan with default properties.

What are the benefits of using SpringBoot starter?

Answer: Dependency management is a vital part of all projects. When a project becomes quite complex, managing dependencies can become a nightmare because there are too many artifacts involved.

At this time SpringBoot starter comes in handy. Each statuser is playing the role of a one-stop shop that provides the Spring features we need. Other required dependencies are injected and managed in a consistent manner.

All starters belong to the org.springframework.boot group, and they all have names beginning with spring-boot-starter-. This naming method makes it easier for us to find starter dependencies, especially when we use those IDEs that support finding dependencies by name.

SpringBoot provides a lot of starters, of which the most commonly used are:

Do you know these SpringBoot interview questions?

How to customize a starter using SpringBoot?

Very, simple, refer to this article of mine: "Teach you to create a SpringBoot custom Starter"

To unlock more interview questions about SpringBoot, please scan the small program code below the code to learn for free!

Guess you like

Origin blog.51cto.com/15127565/2666196