1.Spring Bootsimplifies the initial setup and development of spring applications, saves development costs and time, and increases developer productivity
2. includes many out-of-the-box microservices capabilities to deploy projects with spring cloud can be run independently, provides application monitoring, and can be deployed in conjunction with MicroServices.
3. Spring Boot simplifies the configuration file, it uses "habits better than Configuration" (there are a lot of configurations in the project, plus a built-in configuration that allows you to run your project quickly with the idea that you don't have to manually configure them).
3.1, the project uses a lot of default configuration class, as long as the corresponding annotations, you can refer to the corresponding configuration file, of course, you can also manually write the configuration file.
@SpringBootApplication: The core annotations of the Spring boot project, the main purpose of which is to turn on automatic configuration, is a combination of annotations, including annotations of @ springbootconfiguration+ @EnableAutoConfiguration + @ComponentScan .
@RestController annotations are equivalent to @responsebody + @Controller combined
@Configuration: This is a configuration class that configures spring.
@Controller: Indicate that this is a SPRINGMVC controller.
@ResponseBody: If you need to return Json,xml or customize mediatype content to the page, You need to add the @responsebody annotation to the corresponding method
Main method: Launches an application in the Main method, which is the entry for this application.
4. If we do not want to use the default configuration in the program, you can exclude this configuration item by using annotations on the program-initiated class, @SpringBootApplication (exclude={ Mongodataautoconfiguration.class})
5, If we now use the SPRINGMVC function in the spring program, use annotations @enablewebmvc
6, when the project starts, we use the XML configuration file to initialize some beans, we have to take advantage of @importresoure (locations = {"Classpath:path"})
7, the use of spring oot upload files, you must use annotations @bean instantiation multipartconfigelement; If you jump to the appropriate JSP page, the materialized view parser Urlbasedviewresolver
8, define the Swagger configuration class, apiswaggerconfig inherit Webmvcconfigureradapter class, to implement the encoding of the configuration.
9. Finally run the Spring boot project, you can run Java application directly, or MAVEN command SPRING-BOOT:RUN;LIUNX environment to write a startup script yourself, or the command line to run the jar.
Spring Cloud (ii): Spring Boot Technology Summary