One, what is SpringBoot
Spring Boot is a brand new framework provided by the Pivotal team. Its design purpose is to simplify the initial setup and development of new Spring applications.
Two, install IntelliJ IDEA and Tomcat
Three, create a new Spring Boot project
Fourth, create a new UserController class
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
class UserController {
@RequestMapping("/demo")
public String getUserList() {
return "hello world";
}
}
5. Open the browser after running, enter http://localhost:8080/demo , and get the following results
6. The first pit stepped on:
1. After opening it, I found that my project DemoApplication was not imported. After a few searches, I found that it was because my Maven was not installed in the default location. You can change the following settings
2. The osbdLoggingFailureAnalysisReporter error occurs when running the project because port 8080 is occupied. The solution is to run the console as an administrator, close the port 8080 process, and rerun the project
netstat -ano | findstr 8080
taskkill /pid 13416 /f