首先我们先查看Spring Boot中支持几种嵌入式容器
选中ConfigurableWebServerFactory类,点击ctrl+h键,查看

切换到jetty容器步骤如下
1.排除掉tomcat

2.添加jetty坐标
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
3.启动

切换成功

浙公网安备 33010602011771号