第01章—快速构建
spring boot 系列學(xué)習(xí)記錄:http://www.cnblogs.com/jinxiaohang/p/8111057.html
碼云源碼地址:https://gitee.com/jinxiaohang/springboot
?
一、Spring Initializr 使用教程 (IntelliJ IDEA)
具體步驟:
1、打開(kāi)IDEA ,Create New Project 或者?File -> New - > Project。
?
2、填寫(xiě)組織信息,工程名稱(chēng),打包類(lèi)型選擇Jar。
?
3、選取依賴,這里我們選擇Web依賴。
?
4、核對(duì)工程名稱(chēng)和工程路徑,默認(rèn)不變
?
5、測(cè)試程序能否正常運(yùn)行
?
二、Spring Initializr 使用教程 ( Eclipse )
具體步驟:
步驟1 : 使用瀏覽器打開(kāi):?http://start.spring.io
步驟2 : 填寫(xiě)項(xiàng)目相關(guān)信息,選取依賴,然后生成項(xiàng)目。
步驟3 : 解壓項(xiàng)目,在Eclipse導(dǎo)入Maven工程。
?
二、實(shí)現(xiàn)helloworld
1、編輯SpringbootHelloworldApplication類(lèi)
package com.xiaohang.springboothelloworld;import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ResponseBody;@SpringBootApplication @Controller public class SpringbootHelloworldApplication {@GetMapping("/")@ResponseBodypublic String index() {return "Hello World!";}public static void main(String[] args) {SpringApplication.run(SpringbootHelloworldApplication.class, args);} }2、啟動(dòng)項(xiàng)目,訪問(wèn)localhost:8080
效果如上。
?
轉(zhuǎn)載于:https://www.cnblogs.com/jinxiaohang/p/8195938.html
總結(jié)
- 上一篇: 冰女出CD鞋还是法穿鞋?现在这个版本的e
- 下一篇: html/css杂题