当前位置:网站首页>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>
边栏推荐
- When using gbase 8C database, an error is reported: 80000502, cluster:%s is busy. What's going on?
- How can gbase 8C database view the login information of the login user, such as the date, time and IP of the last login authentication?
- 字符串、、
- 9、 Disk management
- 不要再说微服务可以解决一切问题了!
- 脚手架开发基础
- 使用GBase 8c数据库过程中报错:80000502,Cluster:%s is busy,是怎么回事?
- Codeforces Round #804 (Div. 2)
- Web3基金会「Grant计划」赋能开发者,盘点四大成功项目
- DOM//
猜你喜欢

Wechat nucleic acid detection appointment applet system graduation design completion (6) opening defense ppt
![[JS learning notes 54] BFC mode](/img/47/a07084ef6064589d2eeb6f091753e0.png)
[JS learning notes 54] BFC mode

如何让全彩LED显示屏更加节能环保

Codeforces Round #804 (Div. 2)

【DNS】“Can‘t resolve host“ as non-root user, but works fine as root

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

修复动漫1K变8K

csdn软件测试入门的测试基本流程
![[JS] extract the scores in the string, calculate the average score after summarizing, compare with each score, and output](/img/96/b8585205b3faf503686c5bbdcecc53.png)
[JS] extract the scores in the string, calculate the average score after summarizing, compare with each score, and output

LSTM applied to MNIST dataset classification (compared with CNN)
随机推荐
9、 Disk management
2021年山东省赛题库题目抓包
[JS learning notes 54] BFC mode
A mining of edu certificate station
[first release in the whole network] (tips for big tables) sometimes it takes only 1 minute for 2 hours of SQL operation
Pull up loading principle
Explanation of message passing in DGL
DGL中异构图的一些理解以及异构图卷积HeteroGraphConv的用法
Nine degrees 1480: maximum ascending subsequence sum (dynamic programming idea for the maximum value)
Repair animation 1K to 8K
微信核酸检测预约小程序系统毕业设计毕设(7)中期检查报告
关于 “原型” 的那些事你真的理解了吗?【上篇】
msfconsole命令大全,以及使用说明
磨礪·聚變|知道創宇移動端官網煥新上線,開啟數字安全之旅!
R3Live系列学习(四)R2Live源码阅读(2)
Nuxt//
括号匹配问题(STL)
How to close the log window in vray5.2
String
DDRx寻址原理