Spring boot MVC: can't find JSP

前端 未结 5 1026
忘了有多久
忘了有多久 2021-02-13 05:08

Problem: I can\'t reach my view under WEB-INF/jsp on my Spring Boot web MVC app.

What I\'ve done:

this is my JSP:<

相关标签:
5条回答
  • 2021-02-13 05:45
    <dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-jasper</artifactId>
    <scope>required</scope>
    </dependency>
    

    Added this to my project that is in Intellj and it works..

    0 讨论(0)
  • 2021-02-13 05:57

    Add Tomcat Embed Jasper Dependency in pom.xml file

    <dependency>
        <groupId>org.apache.tomcat.embed</groupId>
        <artifactId>tomcat-embed-jasper</artifactId>
        <version>9.0.30</version>
    </dependency>
    
    0 讨论(0)
  • 2021-02-13 05:59

    Zio, Are you sure you've included this dependency on your pom ?

    <dependency>
       <groupId>org.apache.tomcat.embed</groupId>
       <artifactId>tomcat-embed-jasper</artifactId>
       <scope>provided</scope>
    </dependency>
    

    Without this, I'm getting your same error.

    0 讨论(0)
  • 2021-02-13 06:02

    If you've moved from using the standard thymeleaf project to Bootstrap (as I have), ensure you remove this dependency;

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
    
    0 讨论(0)
  • 2021-02-13 06:07

    I'am adding this in my maven dependecies and now it's working

    <dependency>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-starter-tomcat</artifactId>
     <scope>provided</scope>
    </dependency>
    
    0 讨论(0)
提交回复
热议问题