There are three types of SpringBoot applications:
- none
- Servlet-based web application
- Reactive web application.
Then for the convenience, I posted the code of the relevant class:
In Spring's many annotations, it is often found that many different attributes of different annotations play the same role, such as @RequestMapping's value
attribute and path
attribute. In order to keep their behavior consistent, such as the value of value
and the value of path
can not conflict, their values should always be equal. To handle these issues uniformly, Spring created the @AliasFor tag.
The @AliasFor tag has the following usage methods.
For example, the usage in @RequestMapping:
We use Spring Boot, which is basically intoxicated by the convenience of its Staters. Starter brings us a lot of automation configuration, with these automated configurations, we can build a production-level development environment with little effort, and some friends will think this Starter is amazing! In fact, Starter is also the basic knowledge point in Spring. Today, codeman will implement a Starter with you, slowly revealing the mystery of Starter!
A starter generally contains the following:
We have been learning and applying Spring Boot for some time. How much do you know about Spring Boot annotations? Today I collected the 25 core annotations of Spring Boot, which everyone must master!
This is the most central annotation of Spring Boot. It is used on the Spring Boot main class to identify this as a Spring Boot application that is used to enable Spring Boot. In fact, this annotation is a combination of the three annotations @SpringBootConfiguration
, @EnableAutoConfiguration
, @ComponentScan
. You can also use these three annotations instead of the @SpringBootApplication
annotation.
Allow Spring Boot to automatically configure annotations. After opening this annotation, Spring Boot can configure Spring Beans based on packages or classes in the current classpath.
For example, if the current classpath has the JAR package of Mybatis, then the @MybatisAutoConfiguration
annotation ca