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

springboot快速入门

springboot快速入门

springboot是对spring的封装,基于约定大于配置的思想。SpringBoot要求,项目要继承SpringBoot的起步依赖spring-boot-starter-parent也就是在创建springboot工程的时候,所有的项目都需要依赖parent。

  1. 创建maven项目
  2. 添加springboot的起步依赖
 <parent>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-parent</artifactId>
 <version>2.0.1.RELEASE</version>
 </parent>
  1. 集成springmvc对controller层的开发,引入对web的起步依赖
   <dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-web</artifactId>
   </dependency>
  1. 编写引导类,使用@SpringBootApplication注解注明引导类
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class QuickStartApplication {
    public static void main(String[] args) {
        SpringApplication.run(QuickStartApplication.class, args);
    }
}
  1. 启动springboot项目

http://www.kler.cn/news/162425.html

相关文章:

  • python3: jieba(“结巴”中文分词库) .2023-11-28
  • 028:简单的foreach
  • Android Studio的笔记--String和byte[]
  • 朴素贝叶斯 贝叶斯方法
  • Servlet should have a mapping
  • 使用ASIRequest库进行Objective-C网络爬虫示例
  • Mysql自动备份脚本(本地备份、远程备份、删除冗余备份)
  • 记录 | 使用samba将ubuntu文件夹映射到windows实现共享文件夹
  • C语言——2048完整版
  • Kubernetes - 为什么 K8S 在容器里不能调用自己?
  • 制作一个RISC-V的操作系统三-编译与链接
  • 理解 HTTP POST 请求:表单与 JSON 数据格式深入解析20231208
  • JVM的内存结构详解「重点篇」
  • el-form表单校验值为0提示校验不通过
  • 圣诞树网页效果代码详解
  • 应急响应-挖矿病毒处理
  • 【C语言】字符串函数strlen #strcpy #strcmp #strcat #strstr及其模拟实现
  • JS APl关于电梯导航做法(ES6)
  • 正则表达式详细讲解
  • openEuler JDK21 部署 Zookeeper 集群
  • 盘点11月Sui生态发展,了解Sui的近期成长历程!
  • springboot3.0更新后,idea创建springboot2.x项目
  • js写旋转的时钟动态
  • 在Windows 10或11中,复制和粘贴不起作用,不一定是键盘的问题
  • canvas基础:绘制虚线
  • Python 爬虫 之scrapy 框架
  • SAP 后继物料简介
  • promethesu告警规则配置,alertmanager通过webhook通知
  • 使用Rust 构建C 组件
  • php爬虫规则与robots.txt讲解