01、SpringBoot中关于tomcat的一些常用配置

1、配置端口等信息

#配置端口号
server.port=8081
#配置上下文路径
server.servlet.context-path=/admin
#配置tomcat编码
server.tomcat.uri-encoding=utf-8

2、移除自带的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>


        <dependency>
            <groupId> org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jetty</artifactId>
        </dependency>
原文地址:https://www.cnblogs.com/phdeblog/p/13098136.html