小白用idea从零搭建Springboot项目,超详细
2020-03-28 20:03
316 查看
一、新建Springboot项目
(1)打开idea,file->new->project->Spring Initializr,然后点next
(2)填写Group和Artifact,然后点next
(3)选择web->spring web,点击next
(4)选择保存项目的路径,也可使用默认的,然后点finish
(5)到这里项目就搭建好了,如下图的样子:
二、启动测试
(1)在com.blank.test新建controller包,然后新建一个HelloController类
(2)编写代码启动项目
[code]package com.blank.test.controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class HelloController { @RequestMapping("/hello-world") public String sayHelloWorld(){ return "hello-world"; } }
(3)默认端口是8080,可在application.properties配置文件中修改端口号。此处我使用的是默认端口,在网页中打开如下图:
到此一个项目就创建好了
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- 使用IDEA搭建一个简单的SpringBoot项目——详细过程
- IDEA基于支付宝小程序搭建springboot项目的详细步骤
- SpringBoot(一):使用IDEA快速搭建一个SpringBoot项目(详细)
- 使用IDEA搭建一个简单的SpringBoot项目——详细过程
- IDEA+Gradle+Springboot2.1.5 搭建多模块项目(最详细版)
- IDEA下快速搭建Springboot项目
- 基于maven使用IDEA搭建和部署SpringBoot多模块项目(Multi-Module)
- 用Idea基于SpringBoot搭建Web项目
- Idea 搭建SpringBoot+Mybatis项目
- 使用IDEA搭建SpringBoot项目整合Mybatis踩的坑。。。。
- 使用IDEA搭建SpringBoot-web项目
- IDEA上面搭建一个SpringBoot的web-mvc项目
- idea上搭建springboot+mybatis项目
- 使用idea+springboot+Mybatis搭建web项目
- IDEA 快速搭建springboot项目,返回HTML首页
- idea将Web项目导出为war包(非SpringBoot搭建)
- SpringBoot学习:IDEA中快速搭建springboot项目
- IDEA搭建SpringBoot项目,以及简单使用
- springboot2.1.4整合和配置(一)—— 使用idea搭建boot maven聚合项目
- IDEA搭建SpringBoot+Maven+Mybatis+MySQL-Web项目流程