切换其他嵌入式的servlet容器

  作者:记性不好的阁主

修改pom文件


先排除默认的tomcat容器

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<!-- 排除默认的tomcat -->
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>



1、切换为jetty容器


在文件中添加:


<!-- 引入其他servlet容器 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>


2、切换为undertow容器 (不支持JSP页面)


<!-- 引入其他servlet容器 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>


相关推荐

评论 抢沙发

表情

分类选择