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

记录一次成功的springboot2

pom文件

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>org.example</groupId><artifactId>untitled</artifactId><version>1.0-SNAPSHOT</version><properties><maven.compiler.source>18</maven.compiler.source><maven.compiler.target>18</maven.compiler.target><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.7.11</version> <!-- 使用你需要的版本 --></parent><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency></dependencies></project>

Java文件

package com.t;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;@RestController
@SpringBootApplication
public class Mp {@RequestMapping("/")String home() {return "Hello World!";}public static void main(String[] args) {SpringApplication.run(Mp.class, args);System.out.println("ssssssssssssssssssssssss");System.out.println("ssssssssssssssssssssssss");System.out.println("ssssssssssssssssssssssss");System.out.println("ssssssssssssssssssssssss");}
}

 运行后,浏览器访问localhost:8080

http://www.jsqmd.com/news/24999/

相关文章:

  • 算法学习-素数筛法【埃氏筛法、线性筛法】
  • Day 18
  • Jenkins Share Library教程 —— 企业级 Jenkins Shared Library 实战示例
  • STM32之fromelf生成bin和反汇编文件
  • 25.10.28联考题解
  • 2025年河南工业大学2025新生周赛(1)
  • excel查找满足条件的第二项
  • 【传奇开心果系列】基于Flet框架实现的跷跷板动画自定义模板特色和实现原理深度解析 - 指南
  • CF506E Mr. Kitayutas Gift
  • 常用存储器介绍
  • 记录一次成功的springBoot
  • 2025.10.28总结
  • 代码大全2阅读笔记(1)
  • 进程与进程间通信(IPC)
  • QT:键盘事件(添加资源图片)
  • 2025.10.28
  • docker desktop:更新WSL2+安装nginx
  • # 学代码--看懂了但是不会写
  • 2025-10-28 aoao Round 比赛总结
  • P11307 [COTS 2016] 建造费 Pristojba 分析
  • 程序员如何打破职业瓶颈?先搬开这3块绊脚石。
  • 乱学点东西#2 :菠萝/蓝莓/Boruvka算法
  • 文件清理,推荐几款常用软件
  • AI时代的设计师:从工具到“超人”的进化之路
  • MyBatis 动态 SQL 实现原理 - Higurashi
  • bililun
  • 《程序员修炼之道:从小工到专家》观后感第二篇
  • 【学习笔记】数据结构全家桶
  • 社区
  • 「Gym 102759I」Query On A Tree 17