IDEA快速搭建spring?boot項目教程(Spring?initializr)
IDEA快速搭建spring boot項目
1.創(chuàng)建項目
老規(guī)矩,點擊Create New Project
2.編寫控制器
在com.demo.springbootquickdemo包下創(chuàng)建controller包,在controller包下創(chuàng)建類QuickDemoController,內(nèi)容如下:
package com.demo.springbootquickdemo.controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @Controller和@RequestBody的結(jié)合 */ @RestController public class QuickDemoController { @RequestMapping("hello") public String hello(){ return "hello world,spring-boot quick"; } }
3.運行項目
運行完之后在瀏覽器輸入http://localhost:8080/hello,結(jié)果:
IDEA添加配置SpringBoot Spring Initializr工具
如何在idea中添加Spring Initializr工具
新手在剛剛安裝idea工具后,打算構(gòu)建一個SpringCloud工程,卻發(fā)現(xiàn)找不到構(gòu)建工程的Spring Initializr工具。
如下圖:
接下來我們需要手動給idea下載Spring Initializr所需要的插件
1.點擊file–點擊settings–點擊plugins
2.搜索spring – 找到Spring Assistant
3.點擊install,等待加載完成后重啟idea
這時候就能看到Spring Initializr工具了。
以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
Spring?Boot?+?Spring?Batch?實現(xiàn)批處理任務(wù)的詳細教程
這篇文章主要介紹了Spring?Boot+Spring?Batch實現(xiàn)批處理任務(wù),本文給大家介紹的非常詳細,對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下2023-08-08常用的ResponseEntity.BodyBuilder和自定義ResponseEntity的實例
這篇文章主要介紹了常用的ResponseEntity.BodyBuilder和自定義ResponseEntity的實例,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2024-07-07詳解Java中Vector和ArrayList的區(qū)別
這篇文章主要為大家詳細介紹了Java中Vector和ArrayList的區(qū)別,具有一定的參考價值,感興趣的小伙伴們可以參考一下2016-10-10關(guān)于kafka-consumer-offset位移問題
這篇文章主要介紹了關(guān)于kafka-consumer-offset位移問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2023-03-03springboot整合apache ftpserver詳細教程(推薦)
這篇文章主要介紹了springboot整合apache ftpserver詳細教程,本文給大家介紹的非常詳細,具有一定的參考借鑒價值,需要的朋友可以參考下2020-01-01