In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "what are the core functions of Springboot and its advantages and disadvantages". The content is simple and clear. I hope it can help you solve your doubts. Let the editor lead you to study and learn "what are the core functions of Springboot and what are its advantages and disadvantages?"
Core functions of SpringBoot
1. Run the Spring project independently
Spring boot can be run independently as a jar package, and a Spring Boot project only needs to be run through java-jar xx.jar.
2. Embedded servlet container
Spring Boot can choose to embed Tomcat, jetty, or Undertow so that we don't have to deploy the project as a war package.
3. Provide starter to simplify Maven configuration
Spring provides a series of start pom to simplify the dependency loading of Maven. For example, when you use spring-boot-starter-web, you will automatically add the dependency package shown in figure 5-1.
4. Automatic assembly Spring
SpringBoot automatically configures Bean for the classes in the jar package according to the jar package, classes, and classes in the classpath, which greatly reduces the configuration we want to use. Of course, SpringBoot only considers most development scenarios, not all of them. If we need to configure Bean in actual development, and SpringBoot provides support, we can customize the automatic configuration.
5. Application monitoring of quasi-production
SpringBoot provides http ssh telnet-based monitoring of run-time projects.
6. No code production and xml configuration
SpringBoot is not implemented with code generation, but through conditional annotations, which is a new feature provided by Spring4.x.
Advantages and disadvantages of SpringBoot:
Build the project quickly.
Unconfigured integration of mainstream development frameworks.
The project can be run independently without external dependence on the Servlet container.
-provides application monitoring at run time.
It greatly improves the efficiency of development and deployment.
Natural integration with cloud computing.
Disadvantages:
If you don't agree with the spring framework, maybe this is a drawback.
SpringBoot characteristics
Create a separate Spring project
Built-in Tomcat and Jetty containers
Provide a starter POMs to simplify Maven configuration
Provides a series of non-functional features common in large projects, such as security, metrics, health testing, external configuration, etc.
No code generation and xml configuration files at all
SpringBoot CLI
SpringBoot CLI is a console command tool provided by SpringBoot.
SpringBoot maven build project
Spring-boot-starter-parent: is a special Start that is used to provide related Maven dependencies. After using it, the commonly used package dependencies can omit the version tag.
Several commonly used Notes on SpringBoot
(1) @ RestController and @ Controller specify a class as an annotation for the controller and explain the difference
(2) @ RequestMapping method-level mapping annotations, which are familiar to a partner who has used Spring MVC.
(3) @ EnableAutoConfiguration and @ SpringBootApplication are class-level annotations. Automatically guess the correct configuration of spring according to the jar of maven dependency. As long as spring-boot-starter-web dependency is introduced, Spring MVC and tomcat containers will be automatically configured by default.
(4) @ Configuration class-level annotation. Generally, this annotation is used to identify the class where the main method is located and to complete the initialization of the metadata bean.
(5) @ ComponentScan class-level annotation, which automatically scans and loads all Spring components, including Bean injection, and is generally used on the class where the main method resides
(6) @ ImportResource class-level annotations, and when we have to use a xml configuration, use @ ImportResource and @ Configuration to identify the class of this file resource.
(7) @ Autowired annotation, usually combined with @ ComponentScan annotation, to automatically inject a Service or Dao-level Bean
(8) @ Component class-level annotation, which is used to identify a component. For example, if I customize a filter, I need this annotation to identify Spring Boot correctly.
How does springboot manage transactions? Just write the @ transactional annotation, which is a method transaction in a method and a class transaction in a class.
These are all the contents of this article entitled "what are the core functions of Springboot and what are its advantages and disadvantages?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.