(一)IDEA工具開第一個springboot應用之helloworld
阿新 • • 發佈:2017-11-08
control api 結構 spring maven https tro idt .cn
(一)IDEA工具開第一個springboot應用之helloworld
一、前置知識
1、maven相關知識
2、spring註解
3、RESTful API
二、idea開發第一個springboot的應用helloworld
idea官網:https://www.jetbrains.com/idea/
1、新建工程
springboot基於jdk1.8
2、創建項目名稱
3、選擇maven的pom文件的依賴
4、選擇項目存放路徑
5、本地maven配置阿裏雲的maven鏡像
6、刪除不需要的文件
7、項目結構
8、啟動項目
8、項目正常啟動,端口為8080
9、瀏覽器訪問測試,地址localhost:8080,返回404,表示項目啟動正常
10、新建類HelloController
@RestController public class HelloController { @RequestMapping(value = "/hello",method = RequestMethod.GET) public String say (){ return "hello spring boot!"; } }
11、啟動項目再次訪問,地址:http://localhost:8080/hello
簡單的springboot入門案例到此完成
(一)IDEA工具開第一個springboot應用之helloworld