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--
This article shows you the method of building the environment in SpringBoot2, which is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
Guide package
Org.springframework.boot spring-boot-starter-parent 2.1.6.RELEASE org.springframework.boot spring-boot-starter-web
Startup class
Package com.zz;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;/** * right-"run as application runs the main method of the startup class to start the springboot project. SpringBoot comes with tomcat. When you run this main method, you will launch tomcat * @ author jiyu * * / @ SpringBootApplicationpublic class App {public static void main (String [] args) {/ / TODO Auto-generated method stub SpringApplication.run (App.class, args);}} right-click-"run as application runs the main method of the startup class to start the springboot project. SpringBoot comes with tomcat, and when you run this main method, tomcat starts the log of successful startup at the same time. _ _ / / _ _ _ (() _ _ _ |'_ _ _ | |\ / _ _ _ | | | (_ _ | |) )'| _ |. _ _ | _ | | _ | _ | | _\ _ _ | | / = | _ | = | _ _ / = / _ /:: SpringBoot:: (v2.1.6.RELEASE) 2019-08-03 21 purge 27 INFO 18.453 INFO 16564-[main] com.zz.App: Starting App on DESKTOP-9FM4ENL with PID 16564 (C:\ bsea\ wp\ 2019\ 07\ 02\ SpringBoot2\ SpringBootBasic\ target\ classes Started by jiyu in C:\ bsea\ wp\ 2019\ 07\ 02\ SpringBoot2\ SpringBootBasic) 2019-08-03 21 wp 27 purge 18.460 INFO 16564-[main] com.zz.App: No active profile set Falling back to default profiles: default2019-08-03 21 INFO 27 INFO 16564-[main] o.s.b.w.embedded.tomcat.TomcatWebServer: Tomcat initialized with port (s): 8080 (http) 2019-08-03 21 21 Starting service 21.342 INFO 16564-[main] o.apache.catalina.core.StandardService: Starting service [Tomcat] 2019-08-03 2127 INFO 21.343 INFO 16564-[ Main] org.apache.catalina.core.StandardEngine: Starting Servlet engine: [Apache Tomcat/9.0.21] 2019-08-03 21 INFO 27Apache Tomcat/9.0.21 21.496 INFO 16564-[main] o.a.c.c.C. [tomcat]. [localhost]. [/]: Initializing Spring embedded WebApplicationContext2019-08-03 21 Starting Servlet engine 2721.496 INFO 16564-[main] o.s.web. Context.ContextLoader: Root WebApplicationContext: initialization completed in 2926 ms2019-08-03 21 initialization completed in INFO 2721.736 INFO 16564-[main] o.s.s.concurrent.ThreadPoolTaskExecutor: Initializing ExecutorService 'applicationTaskExecutor'2019-08-03 21 o.s.b.w.embedded.tomcat.TomcatWebServer 2721.947 INFO 16564-[main] o.s.b.w.embedded.tomcat.TomcatWebServer: Tomcat started on port (s): 8080 (http) with context path' 2019-08 -03 21 com.zz.App 27 charge 21.950 INFO 16564-[main] com.zz.App Test controllerpackage com.zz.controller Import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;@RestControllerpublic class TestController {@ RequestMapping ("hello") public String T1 () {return "hello SpringBoot";}}
test
Add hot start function
STS or Eclipse only need to add a package to the pom file to achieve hot startup.
The above content of org.springframework.boot spring-boot-devtools true is the method of building environment in SpringBoot2. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are 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.