19、springboot——使用其他Servlet容器

使用其他Servlet容器

 

-Jetty(长连接)
-Undertow(不支持jsp)

 

 

 替换为其他嵌入式Servlet容器

 

 
默认支持:
Tomcat(默认使用)

 

Jetty:

复制代码
<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>

<!--引入其他的Servlet -->
<dependency>
     <artifactId>spring‐boot‐starter‐jetty</artifactId>
     <groupId>org.springframework.boot</groupId>
</dependency>
复制代码

 

 

Undertow:

复制代码
<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>

<!--引入其他的Servlet -->
<dependency>
     <artifactId>spring‐boot‐starter‐undertow<</artifactId>
     <groupId>org.springframework.boot</groupId>
</dependency>
复制代码

 

右键排除依赖

posted @ 2020-03-21 16:17  Arbitrary233  阅读(179)  评论(0)    收藏  举报