日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

spring boot hello world 搭建

發(fā)布時間:2023/11/27 生活经验 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 spring boot hello world 搭建 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

?

1.下載地址:

Eclipse:http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/neonr

Spring Tool Suite:https://spring.io/tools/sts/all

?

2.使用版本為:

Eclipse:eclipse-jee-neon-R-win32-x86_64.zip

Spring Tool Suite:springsource-tool-suite-3.9.0.RELEASE-e4.6.3-updatesite.zip

?

2.插件安裝:

  采用離線安裝,安裝方式類似svn的安裝。

?

3.新建工程:

?

注意,過程中選擇相應的組件,如web,mybatis,redis 等。

?

4.hello?World 代碼的編寫

?共兩個類。

類1:

package com.example.first;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;  
import org.springframework.web.bind.annotation.PathVariable;  
import org.springframework.web.bind.annotation.RequestMapping;  
import org.springframework.web.bind.annotation.RestController;  @RestController  
@EnableAutoConfiguration  
public class Example {  @RequestMapping("/")  String home() {  return "Hello World!";  }  @RequestMapping("/hello/{myName}")  String index(@PathVariable String myName) {  return "Hello "+myName+"!!!";  }  
}  


類 2:

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

?

5.啟動方式

? 右鍵項目名稱,run as application ,選擇上面的Application 類。

?瀏覽器輸入?http://localhost:8080/ ? 即可看到 ?Hello World!

?

轉載于:https://www.cnblogs.com/xzzq/p/7225470.html

總結

以上是生活随笔為你收集整理的spring boot hello world 搭建的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內容還不錯,歡迎將生活随笔推薦給好友。