springboot questions and answers

What is the core annotation of Spring Boot? Which annotations are mainly composed of?

The annotation on the startup class is @SpringBootApplication, which is also the core annotation of Spring Boot. The main combination includes the following 3 annotations:
@SpringBootConfiguration: Combines the @Configuration annotation to realize the function of the configuration file.
@EnableAutoConfiguration: Turn on the automatic configuration function, you can also turn off a certain automatic configuration option, for example: java If you turn off the data source automatic configuration function: @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }). @ComponentScan: Spring component scanning.

What logging frameworks does Spring Boot support? Which is the recommended and default logging framework?
Spring Boot supports Java Util Logging, Log4j2, Lockback as the logging framework. If you use Starters, Spring Boot will use Logback as the default logging framework, but regardless of the type of logging framework, it supports outputting configuration files to the console or files in.

How SpringBoot Starter works

I personally understand that SpringBoot is a combination of various
Starters . We can also develop Starter ourselves. When sprinBoot is started, @SpringBootApplication will automatically go to maven to read the spring.factories file in each starter. All of the files are configured in this file. The bean in the spring container needs to be created and auto-configured to inject the bean into the SpringContext//(SpringContext is Spring's configuration file)

What are the new features of Spring Boot 2.X? What is the difference with 1.X?
Configuration change
JDK version upgrade Third-party class library upgrade
Responsive Spring programming supports
HTTP/2 Support configuration attribute binding
More improvements and enhancements

What front-end templates are supported by SpringBoot,
thymeleaf, freemarker, jsp, the official does not recommend JSP will have restrictions

Guess you like

Origin blog.csdn.net/qq_42918433/article/details/113822299