1. 程式人生 > >SpringBoot整合SpringMVC

SpringBoot整合SpringMVC

1.建立Maven專案,加入起步依賴spring-boot-starter-parent,建立專案的時候就加入

2.建立專案後加入SpringMVC依賴spring-boot-starter-web

3.建立啟動類

@SpringBootApplication
public class SpringBootApplicationRunner {
	public static void main(String[] args) {
		SpringApplication.run(SpringBootApplicationRunner.class, args);
	}

}

4.執行啟動類main()方法

5.訪問http://localhost:8080

Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Sun Dec 16 14:06:20 CST 2018
There was an unexpected error (type=Not Found, status=404).
No message available