SpringBoot2.x tomcat jetty undertow 切换

SpringBoot2.x tomcat jetty undertow 切换

springBoot 提供有三种servlet容器: Tomcat,Jetty,Undertow
默认使用的是tomcat

1.移除默认的tomcat
    <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                    <groupId>org.springframework.boot</groupId>
                </exclusion>
            </exclusions>
        </dependency>
2.切换 jetty
       <dependency>
            <artifactId>spring-boot-starter-jetty</artifactId>
            <groupId>org.springframework.boot</groupId>
        </dependency>

在这里插入图片描述

3.切换 undertow
       <dependency>
            <artifactId>spring-boot-starter-undertow</artifactId>
            <groupId>org.springframework.boot</groupId>
        </dependency>

在这里插入图片描述

发布了47 篇原创文章 · 获赞 7 · 访问量 2350

猜你喜欢

转载自blog.csdn.net/qq_43616898/article/details/104154962