SpringBoot学习--替换框架或者容器
1.对于springboot替换框架的操作:
a.在springboot的maven的pom.xml问价中,删除(排除)掉相应的依赖
b.在pom.xml中添加相应的依赖
c.更新项目的依赖
替换springboot的内容器为 tomcat->jetty
1.在自带的容器中删除掉原来自带的内嵌容器tomcat
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
2,添加所需要的容器jetty (长连接的时候使用)
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
3,完整的代码:
<?xml version="1.0" encoding="UTF-8"?>