spring-boot-starter-web包括spring-boot-starter-tomcat
在spring-boot-starter-tomcat包括tomcat-embed-core
tomcat-embed-core不包括在内tomcat-embed-jasper。事实上,是tomcat-embed-jasper谁包括依赖tomcat-embed-core
tomcat-embed-jasper标记为provided,所以表示您希望JDK或容器在运行时提供依赖关系。此范围仅在编译和测试类路径中可用,并且不可传递。
所以使用内嵌tomcat的时候,需要将tomcat-embed-jasper这个依赖的scope为compile,否则jsp不能正常渲染.,使用外部则可以声明为provided
 

内嵌tomcat:

Spring Boot jsp 页面返回源码,没有渲染_ide