问题出自搭demo的时候,继承了spring boot parent,编译没报错,但是启动报错。
问题出在,父pom(spring boot parent)里依赖,需要声明才能继承
。我忘记声明下面的jar了,当然会找不到servlet了…
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>