In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
1. Spring boot simplifies the initial construction and development process of Spring applications, saves development costs and time, and improves the productivity of developers.
2. It contains many out-of-the-box micro-service features, which can be run independently with spring cloud joint deployment projects, provide application monitoring, and can be jointly deployed with micro-services.
3. Spring boot simplifies the configuration file, using the concept of "habit over configuration" (there are a large number of configurations in the project, and a habitual configuration is built in so that you don't have to configure it manually) to get your project running fast.
3.1. Many default configuration classes are used in the project. As long as you use the corresponding annotations, you can refer to the corresponding configuration file, of course, you can also write the configuration file manually.
The core annotation of the @ SpringBootApplication:Spring Boot project, whose main purpose is to turn on autoconfiguration, is a composite annotation that contains @ SpringBootConfiguration+@EnableAutoConfiguration+@ComponentScan.
The @ RestController annotation is equivalent to the combination of @ ResponseBody + @ Controller
Configuration: this is a configuration class that configures Spring.
Controller: indicates that this is a Controller controller for SpringMVC.
@ ResponseBody: if you need to return JSON,XML or custom mediaType content to the page, you need to annotate the corresponding method with @ ResponseBody
Main method: launch an application in the main method, that is, the entrance to the application.
4. If we do not want to use the default configuration in the program, we can exclude this configuration item by using annotations on top of the class started by the program, @ SpringBootApplication (exclude= {MongoDataAutoConfiguration.class})
5. If we now use the function of springmvc in the spring program, use the annotation @ EnableWebMvc
6. When the project starts, we use the xml configuration file to initialize some bean, using @ ImportResoure (locations = {"classpath:path"})
7. When uploading files using spring oot, you must instantiate MultipartConfigElement; with the annotation @ Bean. If you jump to the corresponding jsp page, then instantiate the view parser UrlBasedViewResolver
8. Define the Swagger configuration class, and ApiSwaggerConfig inherits the WebMvcConfigurerAdapter class to implement the configuration coding.
9. Finally, to run the spring boot project, you can run java application; directly or maven commands the spring-boot:run;liunx environment to write a startup script, or run jar on the command line.
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.