1 介绍
springboot默认配置的是tomcat容器,tomcat是一个重量级容器,今天我来说下我搭建的springboot项目配置的是jetty容器,jetty是一个轻量级的容器。那么下面来说下springboot应该怎么引用jetty容器呢?应该怎么优化呢?
2 这里需要注意一下由于springboot web项目在创建的时候会引入spring-boot-starter-web包,这个包里是默认启动tomcat配置的,所以我们在引入jetty容器前,先剔除掉tomcat的默认配置吧,看下面的pom.xml配置吧
pom.xml配置
<!-- 整体的pom配置我就不再这里粘了 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<!-- 去除默认tomcat配置 -->
<exclusion>
<artifactId>spring-boot-starter-tomcat</artifactId>
<groupId>org.springframework.boot