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

posted @ 2019-03-24 21:21  你就像甜甜的益达  阅读(155)  评论(0编辑  收藏  举报