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

创建spring boot项目

使用https://start.aliyun.com/ 创建一个spring boot项目
1、打开https://start.aliyun.com/,获取代码
在这里插入图片描述
2、解压下载后文件,使用ide打开,pom。xml文件添加,install一下

<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency>

在这里插入图片描述

3、建一个Controller文件
在这里插入图片描述

package com.example.controller;import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;@RestController
public class HelloController {@GetMapping("/hello")public String hello(){return "hello spring,boot";}
}

4、运行DemoApplication.java文件
5、打开http://localhost:8080/hello

http://www.lryc.cn/news/333876.html

相关文章:

  • Mongodb字段更新操作符$currentDate
  • 通信安全之数据加密
  • 花一分钟简单认识 CSS 中的规则 —— 级联层 @layer
  • K8s学习三(Pod与探针)
  • leetcode - 678. Valid Parenthesis String
  • 索尼相机照片清理软件
  • 比赛记录:Codeforces Global Round 25 A~E (猜猜题场)
  • Windows系统安装OpenSSH结合VS Code远程ssh连接Ubuntu【内网穿透】
  • Svg Flow Editor 原生svg流程图编辑器(五)
  • 数字晶体管选型参数,结构原理,工艺与注意问题总结
  • lua学习笔记9(字典的学习)
  • 第六篇: 3.5 性能效果 (Performance)- IAB/MRC及《增强现实广告效果测量指南1.0》
  • mysql学习笔记NO.2
  • C++11:lambda表达式 包装器
  • Node.js HTTP/2 CONTINUATION 拒绝服务漏洞(CVE-2024-27983)
  • YOLOV8 + 双目测距
  • 前端:SVG绘制流程图
  • 【Linux系列】如何确定当前运行的是 RHEL 9 还是 RHEL 8?
  • vscode开发java的插件和配置
  • Mysql启动报错:本地计算机上的mysql服务启动后停止,某些服务在未由其他服务或程序使用时将自动停止
  • WPF程序添加托盘图标
  • 工业4g路由器联网后迅速掉线是什么原因?
  • 腾讯云4核8G服务器12M带宽646元1年零3个月,4C8G使用场景说明
  • java - 读取配置文件
  • Ubuntu22.04平台编译完美解决问题“error: GLSL 4.5 is not supported.”【GLSL(OpenGL着色器语言)】
  • 数据结构之搜索二叉树与关联性容器初接触
  • C语言整数和小数的存储
  • Games101Homework【6】Acceleration structure(Including framework analysis)
  • 应用运维文档1
  • 手机如何在线制作gif?轻松一键在线操作