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

springboot01

目录

新建Maven工程,什么都不选

​pom.xml加上

新建包top.cjz.controller  新建类HelloController

​新建类HelloApplication

​运行浏览器访问


新建Maven工程,什么都不选

 pom.xml加上

    <!--springboot工程需要继承的父工程-->
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.8.RELEASE</version>
    </parent>

    <dependencies>
        <!--web开发的起步依赖-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
    </dependencies>

 

新建包top.cjz.controller  新建类HelloController

package top.cjz.controller;import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;@RestController
public class HelloController {@RequestMapping("/hello")public String hello(){return "Hello SpringBoot";}
}

 新建类HelloApplication

package top.cjz;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplication
public class HelloApplication {public static void main(String[] args) {SpringApplication.run(HelloApplication.class,args);}
}

 运行浏览器访问

 

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

相关文章:

  • 虚拟机中window/ubuntu系统如何联网?
  • 计算物理专题----随机游走实战
  • 《思维与智慧》简介及投稿邮箱
  • flask+python快速搭建
  • 基于微信小程序的美术馆预约平台设计与实现(源码+lw+部署文档+讲解等)
  • ruoyi-vue-pro yudao 项目商城 mall 模块启用及相关SQL脚本
  • default 和 delete 与默认构造函数 的使用
  • 【开发篇】一、热部署
  • 点云从入门到精通技术详解100篇-定子装配过程中基于深度学习的易变形材料的点云分割(下)
  • 谷歌浏览器关闭自动更新功能
  • 电商业务--技术负责人 250K*15
  • MySQL只同步单个表或多个表,非全部同步!
  • 【论文基本功】【LaTeX】个人常用易忘LaTeX命令
  • JVM参数调优——G1收集器
  • Linux cp命令使用指南:详细教程及实际应用场景解析
  • 树结构数据在table中回显 treeselect disabled
  • BOA服务器移植
  • 洛谷刷题入门篇:顺序结构
  • LVS+Haproxy
  • Linux知识
  • Java基础(三)
  • [Firefox/快捷键] 禁用Ctrl-W快捷键
  • Git常用命令diff和mv
  • 【谢希尔 计算机网络】第3章 数据链路层
  • 《DevOps实践指南》- 读书笔记(九)
  • 数据库数据恢复-SQL SERVER数据库分区被格式化的数据恢复方案
  • ubuntu安装ffmpeg
  • CentOS上安装Docker
  • 三相PWM整流器有限集模型预测电流控制MATLAB仿真模型
  • 【JavaEE】多线程(三)