在IDEA里面建立maven项目(便于java web使用)

具体步骤:

第一次有的电脑你再创建项目的时候右下角会提醒你弹窗:让你下载没有的东西

一定要下载!!可能会很慢

运行结果:

因为他是默认的8080端口所以在运行的时候输入的url如下图:

新建了一个controller代码如下

java 复制代码
package cn.lvb.boot01.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class HelloController {
    @RequestMapping("/hello")
    @ResponseBody
    public String hello(){
        return "hello springboot";
    }
}

再运行以下的url 就是上面代码里的内容

到这里说明可以正常运行了~~~

相关推荐
摇滚侠4 分钟前
Spring 零基础入门到进阶 入门 06-10
java·spring·intellij-idea
要开心吖ZSH7 分钟前
AI医疗分诊与健康咨询助手agent开发——(1)从零搭建SpringBoot与AI对话系统:后端骨架 + 前端对话页 + SSE流式输出
java·ai·agent·健康医疗
biubiubiu07069 分钟前
SpringBoot生产级日志配置
java·spring boot·后端
ch.ju18 分钟前
Java Programming Chapter 4——Inherited call
java·开发语言
是有头发的程序猿21 分钟前
竞品分析 + 用户洞察自动化|基于 item_review 评论接口 + 多 AI Agent 实现淘宝评论全量采集与智能分析(附python源码)
java·python·自动化
凤凰院凶涛QAQ27 分钟前
《Java版数据结构 & 集合类剖析》链表与LinkedList:节点手拉手,增删不用愁
java·数据结构·链表
唐青枫39 分钟前
Java MyBatis 实战指南:XML 映射、动态 SQL 与数据访问层设计
java·mybatis
码语智行39 分钟前
MQTT 配置、依赖与使用说明
java·物联网·mt
_日拱一卒40 分钟前
LeetCode:39组合总和
java·算法·leetcode·职场和发展
郝学胜-神的一滴42 分钟前
力扣 662 :二叉树最大宽度
java·数据结构·c++·python·算法·leetcode·职场和发展