当前位置:网站首页>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>
边栏推荐
- 小程序框架Taro
- 【Oracle】使用DataGrip连接Oracle数据库
- [JS] extract the scores in the string, calculate the average score after summarizing, compare with each score, and output
- 32:第三章:开发通行证服务:15:浏览器存储介质,简介;(cookie,Session Storage,Local Storage)
- 2022 Pengcheng cup Web
- SQL Server monitoring statistics blocking script information
- Talk about the understanding of fault tolerance mechanism and state consistency in Flink framework
- Variables///
- csdn软件测试入门的测试基本流程
- regular expression
猜你喜欢
随机推荐
Data types ntext and varchar are incompatible in the not equal to operator - 95 small pang
32:第三章:开发通行证服务:15:浏览器存储介质,简介;(cookie,Session Storage,Local Storage)
函数///
四部门:从即日起至10月底开展燃气安全“百日行动”
PWA (Progressive Web App)
A usage example that can be compatible with various database transactions
赛克瑞浦动力电池首台产品正式下线
uniapp
Advanced scaffold development
Taro advanced
Paradigm in database: first paradigm, second paradigm, third paradigm
About the use of Vray 5.2 (self research notes)
不要再说微服务可以解决一切问题了!
Use bat command to launch common browsers with one click
第五届 Polkadot Hackathon 创业大赛全程回顾,获胜项目揭秘!
Network security of secondary vocational group 2021 Jiangsu provincial competition 5 sets of topics environment + analysis of all necessary private messages I
Explanation of full vulnerability script of network security C module of secondary vocational group script containing 4 vulnerabilities
变量///
Web3 Foundation grant program empowers developers to review four successful projects
数据库三大范式