webflux--启动依赖 <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
<version>2.1.6.RELEASE</version>
</dependency> | netty配置 # http://127.0.0.1:8071/person/save?name=anything01 netty 路径没有context-path
port: 8071
netty:
connection-timeout: 20 |
web--启动依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
| Tomcat配置 server:
# tomcat:
# http://127.0.0.1:8071/apiyml/person/save?name=anything01 tomcat 路劲可以自己就设置 context-path
# uri-encoding: utf-8
# port: 8071
# servlet:
# context-path: /apiyml |
webflux配置中不存在 context-path 所以即使设置了该属性,在启动之后添加对应的配置路径名也不会识别 | 而在Tomcat中可以设置 context-path 存在该属性 |
两种启动方式无法同时存在
简单介绍一下:
netty是一个java的框架,该框架提供功能之一:高可靠性的网络服务器
tomcat 则是一个开源的Java web 服务器。