注意 配置文件是:

对比 spring-web 与 spring-boot-starter-web的区别

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </dependency>

替换为

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

结果:不配置spring-boot-starter-web 无法启动Tomcat

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注