久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術文章
文章詳情頁

詳解IDEA搭建springBoot方式一(推薦)

瀏覽:2日期:2023-04-17 17:34:52

1.先在IDEA配置maven

詳解IDEA搭建springBoot方式一(推薦)

maven下載和配置可以看https://www.jb51.net/article/197309.htm

2.新建maven項目

詳解IDEA搭建springBoot方式一(推薦)詳解IDEA搭建springBoot方式一(推薦)

3.在pom.xml加入springBoot依賴

詳解IDEA搭建springBoot方式一(推薦)

<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.9.RELEASE</version> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies>

4.創建類(用來啟動項目),寫如下代碼

詳解IDEA搭建springBoot方式一(推薦)

package xiaoliu;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplicationpublic class SpringApplicationTest { public static void main(String[] args) { //啟動spring應用 SpringApplication.run(SpringApplicationTest.class,args); }}

5.創建Controller 寫代碼如下

詳解IDEA搭建springBoot方式一(推薦)

5.運行

詳解IDEA搭建springBoot方式一(推薦)詳解IDEA搭建springBoot方式一(推薦)

6.訪問項目

在頁面中輸入http://localhost:8080/hello 即可訪問項目。

詳解IDEA搭建springBoot方式一(推薦)

可以用idea 打包 成jar然后用 java -jar hello.jar 運行springboot 項目springboot中已經自帶了tomcat,所以可以沒有tomcat環境

到此這篇關于IDEA搭建springBoot方式一的文章就介紹到這了,更多相關IDEA搭建springBoot內容請搜索好吧啦網以前的文章或繼續瀏覽下面的相關文章希望大家以后多多支持好吧啦網!

標簽: Spring
相關文章:
主站蜘蛛池模板: 萨嘎县| 花莲县| 东乌| 兖州市| 二连浩特市| 大埔区| 南漳县| 万安县| 霍林郭勒市| 青岛市| 晋城| 凭祥市| 红桥区| 兴文县| 娱乐| 潮州市| 沾益县| 东丰县| 西城区| 建瓯市| 盐亭县| 淳安县| 马关县| 崇礼县| 株洲县| 陆良县| 绥宁县| 乐至县| 南安市| 昂仁县| 宾阳县| 莱西市| 萝北县| 大同市| 民勤县| 清丰县| 衢州市| 馆陶县| 利津县| 莎车县| 兰溪市|