当前位置:网站首页>Basic part - basic project analysis
Basic part - basic project analysis
2022-07-05 11:01:00 【Printf ('xiaobai ');】
Basic project analysis
- SpringBoot advantage
- Start relying on ( Simplify dependencies )
Automatic configuration ( Simplify project related configuration )
Auxiliary function ( Built in server , …)
- Start relying on ( Simplify dependencies )
parent
spring-boot-dependencies-2.6.1.pom Many versions and coordinate relationships are defined in- Alibaba cloud creates a version that directly references
spring-boot-dependencies( Inheritance can only be used once ) Avoid version conflicts when multiple dependencies use the same technology
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
Can only write GA Do not write V
- Join again after encountering errors V Version information , But to
Beware of version conflicts
starter
- One starter Provides various dependencies required by a technology , achieve
The purpose of reducing dependency configuration - Purpose of simplified configuration
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Boot class
- The bootstrap class is Boot The entrance to the execution of the works , function main Method to start the project
- SpringBoot Initialize after the project runs Spring Containers , Scan the package where the boot class is loaded Bean
@SpringBootApplication
public class Springboot0101QuickstartApplication {
public static void main(String[] args) {
ConfigurableApplicationContext run = SpringApplication.run(Springboot0101QuickstartApplication.class, args);
BookController bean = run.getBean(BookController.class);
System.out.println("book--==>"+ bean);
User bean1 = run.getBean(User.class);
System.out.println("User--==>"+ bean1);
}
}
Embedded tomcat
- SpringBoot Built in one tomcat The server
- It can be downloaded from starter-web Exclude and replace with other servers , For example, in the following case
jetty - Common built-in servers
- apache Produce , More fans ,
It's widely used, Several heavier components are loaded
jettyMore lightweight, Load performance is far less than tomcat
undertow Load performance barely outperforms tomcat
- apache Produce , More fans ,
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
边栏推荐
- 关于vray 5.2的使用(自研笔记)
- 32:第三章:开发通行证服务:15:浏览器存储介质,简介;(cookie,Session Storage,Local Storage)
- 【广告系统】Parameter Server分布式训练
- 【Oracle】使用DataGrip连接Oracle数据库
- Go project practice - parameter binding, type conversion
- LDAP overview
- 2022年T电梯修理操作证考试题及答案
- Nine degrees 1480: maximum ascending subsequence sum (dynamic programming idea for the maximum value)
- 中职组网络安全C模块全漏洞脚本讲解包含4个漏洞的脚本
- iframe
猜你喜欢

基于昇腾AI丨以萨技术推出视频图像全目标结构化解决方案,达到业界领先水平

Broyage · fusion | savoir que le site officiel de chuangyu mobile end est en ligne et commencer le voyage de sécurité numérique!

Operation of simulated examination platform of special operation certificate examination question bank for safety production management personnel of hazardous chemical production units in 2022

32: Chapter 3: development of pass service: 15: Browser storage media, introduction; (cookie,Session Storage,Local Storage)

Implement the rising edge in C #, and simulate the PLC environment to verify the difference between if statement using the rising edge and not using the rising edge

【Oracle】使用DataGrip连接Oracle数据库

修复动漫1K变8K

DGL中的消息传递相关内容的讲解

关于vray 5.2的使用(自研笔记)

Based on shengteng AI Yisa technology, it launched a full target structured solution for video images, reaching the industry-leading level
随机推荐
九、磁盘管理
【DNS】“Can‘t resolve host“ as non-root user, but works fine as root
2022 chemical automation control instrument examination questions and online simulation examination
String
uniapp
函数///
Do you really understand the things about "prototype"? [part I]
一次edu证书站的挖掘
Go language-1-development environment configuration
Implement the rising edge in C #, and simulate the PLC environment to verify the difference between if statement using the rising edge and not using the rising edge
Advanced scaffold development
Bidirectional RNN and stacked bidirectional RNN
Talk about the understanding of fault tolerance mechanism and state consistency in Flink framework
数组、、、
Nine degrees 1480: maximum ascending subsequence sum (dynamic programming idea for the maximum value)
2022年T电梯修理操作证考试题及答案
Codeforces Round #804 (Div. 2)
C语言活期储蓄账户管理系统
Lombok 同时使⽤@Data和@Builder 的坑,你中招没?
MFC宠物商店信息管理系统