当前位置: 首页 > news >正文

SpringBootWeb快速入门

步骤:

  1. 创建springboot工程,并勾选web开发相关依赖
  2. 定义HelloController类,添加方法hello,并添加注解
  3. 运行测试

具体如下:
在这里插入图片描述

在这里插入图片描述

编写HelloController类:

package com.example.springbootwebquickstart;import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;// 请求处理类
@RestController
public class HelloController {@RequestMapping("/hello")public String hello() {System.out.println("Hello World");return "Hello World ";}}

启动SpringBoot
在这里插入图片描述

访问8080
在这里插入图片描述


http://www.mrgr.cn/news/4608.html

相关文章:

  • 基于STM32开发的智能家居照明系统
  • leetcode59:螺旋矩阵II
  • 20240823 每日AI必读资讯
  • IDEA中设置类和方法的注释
  • 怎么样提高 ui 自动化测试的成功率?
  • 我的Markdown简历模板开源了!
  • 数据结构+单链表应用
  • 计算机图形学 | 动画模拟
  • PostgreSQL SELECT 语句:深入解析与实例应用
  • [数据集][目标检测]快递包裹检测数据集VOC+YOLO格式5382张1类别
  • 分布式互斥锁优化数据库压力:从基础到高级优化
  • VBA技术资料MF184:图片导入Word添加说明文字设置格式
  • 【排序篇】实现快速排序的三种方法
  • HTML静态网页成品作业(HTML+CSS)——非遗昆曲介绍设计制作(1个页面)
  • 通过拖拽添加dom和一些属性
  • XSS Game闯关
  • 【Python】SQLAlchemy:快速上手
  • KKView远程Microsoft Remote Desktop
  • el-table 表格自定义添加表格数据后自动滚动到最底部
  • 网络 通信