在springboot使用上,当做到在jsp上使用时出现了以下错误:我的天,我哪里错了吗?
springboot集成jsp报错Whitelabel Error Page

目录结构有问题:jsp页面应该放置在/src/main/resources/META-INF/resources/WEB-INF/JSP下面,其中/WEB-INF/JSP和配置文件application.properties中配置的MVC前缀一致

spring-boot 中  @restController ==  @Controller + @ResponseBody,所以:在返回页面的时候controller不能用restController 而是controller

 

另:内嵌Tomcat启动要注释掉

Java code?

1

2

3

4

5

<dependency>

            <groupId>org.apache.tomcat.embed</groupId>

            <artifactId>tomcat-embed-jasper</artifactId>

            <!--<scope>provided</scope>-->

        </dependency>

 

最后这个内嵌Tomcat启动要注释掉我不是太清楚,先留着,以后解决一下,会回来修改的。

相关文章:

  • 2021-08-15
  • 2021-06-14
  • 2021-07-17
  • 2021-10-24
  • 2021-09-05
  • 2021-05-24
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-20
  • 2021-11-20
  • 2021-11-12
  • 2022-01-11
  • 2021-04-23
相关资源
相似解决方案