springboot jsp页面返回源码,没有渲染

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:
在这里插入图片描述

世界上所有的不公平都是由于当事人能力不足造成的.
原文地址:https://www.cnblogs.com/javayida/p/13347044.html