
阿里架构师带你入门Springboot!三分钟学写“Hello,World”程序!
第一个springboot程序Hello,World
我们将学习如何快速的创建一个Spring Boot应用,并且实现一个简单的Http请求处理。通过这个例子对Spring Boot有一个初步的了解,并体验其结构简单、开发快速的特性。
我的环境准备:
- java11
- Maven-3.6.3
- SpringBoot 2.x 最新版
开发工具:
- IDEA
一、创建Springboot项目

建议把服务连接换成阿里云的:https://start.aliyun.com/

二、添加SpringWeb框架,再点击完成

三、可以选择删除多余文件

四、等待项目下载完成

五、springboot主启动类,springboot从这里开始跑

六、新建controller包

七、在controller包下新建HelloWorld类
package com.study.springboot01helloworld.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloWorld {
@RequestMapping("/hello")
public String HelloWorld01(){
return "HelloWorld";
}
}

八、在Springboot主启动类启动项目

九、项目启动完成
1、启动完成提示

2、在网页中输入localhost:8080

3、在网页中输入localhost:8080/hello

分类: Springboot
最新2021整理收集的一些高频面试题(都整理成文档),有很多干货,包含mysql,netty,spring,线程,spring cloud、jvm、源码、算法等详细讲解,也有详细的学习规划图,面试题整理等,需要获取这些内容的朋友请加Q君样:484138291

2万+

被折叠的 条评论
为什么被折叠?



