阿里架构师带你入门Springboot!三分钟学写“Hello,World”程序!

在这里插入图片描述

第一个springboot程序Hello,World

我们将学习如何快速的创建一个Spring Boot应用,并且实现一个简单的Http请求处理。通过这个例子对Spring Boot有一个初步的了解,并体验其结构简单、开发快速的特性。

我的环境准备:

  • java11
  • Maven-3.6.3
  • SpringBoot 2.x 最新版

开发工具:

  • IDEA

一、创建Springboot项目

image

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

image

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

image

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

image

四、等待项目下载完成

image

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

image

六、新建controller包

image

七、在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";
    }
}

image

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

image

九、项目启动完成

1、启动完成提示
image

2、在网页中输入localhost:8080

image

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

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

在这里插入图片描述

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值