网站首页 > 技术文章 正文
通过idea工具创建springBoot项目,需要联网。
创建项目
- File-->New-->Project...
默认你已经安装好jdk了
- 看图操作:从1-->2-->3-->4,Next->Next
- 选择版本:选择SNAPSHOT版本(快照版,长期支持稳定)。
- 选择依赖Spring Web,其他依赖看需要勾选,不勾选也无所谓,后面可以再按需引入。
- Next-->Finish,项目创建完成。
书写代码
打开项目,稍等下,依赖下载完毕(看个人网速快慢)。
看图操作:
package com.example.demo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
class HelloWordController {
@GetMapping("/hello")
public String helloWord() {
return "Hello Word!";
}
}
启动项目
- 找到启动类,鼠标右击运行springBoot项目。
- 看日志,出现启动成功的标志!
Started DemoApplication in 2.063 seconds (JVM running for 4.899)
浏览器访问
访问地址:http://localhost:8080/hello
猜你喜欢
- 2024-10-09 用IDEA把SpringBoot项目打成jar发布项目
- 2024-10-09 SpringBoot 01 环境搭建入门(简单springboot项目搭建)
- 2024-10-09 IDEA中创建Springboot父子工程(idea创建父子项目)
- 2024-10-09 16:实现SpringBoot单个、多个文件的上传
- 2024-10-09 手把手教你用Spring-Boot搭建项目
- 2024-10-09 Spring Boot入门-快速搭建web项目
- 2024-10-09 使用IDEA创建gradle的spring boot项目并提交到DS916+的git server上
- 2024-10-09 Springboot工程建立(springboot工程搭建步骤)
- 2024-10-09 SpringBoot进阶3:项目搭建方法与项目结构分析
- 2024-10-09 SpringBoot+Mybatis多模块(module)项目搭建教程
- 最近发表
- 标签列表
-
- cmd/c (64)
- c++中::是什么意思 (83)
- 标签用于 (65)
- 主键只能有一个吗 (66)
- c#console.writeline不显示 (75)
- js判断是否空对象 (63)
- pythoncase语句 (81)
- es6includes (73)
- sqlset (64)
- phprequire_once (61)
- localstorage.removeitem (74)
- vector线程安全吗 (70)
- & (66)
- java (73)
- org.redisson (64)
- cannotinstantiatethetype (62)
- js数组插入 (83)
- gormwherein (64)
- linux删除一个文件夹 (65)
- mac安装java (72)
- outofmemoryerror是什么意思 (64)
- flask文件上传 (63)
- eacces (67)
- 查看mysql是否启动 (70)
- 无效的列索引 (74)