springboot jsp 页面不解析的2种办法。

通用:

在 pom.xml 里添加依赖

 <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
<!--  这里放开可以解析jsp          <scope>provided</scope>-->
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
        </dependency>
    </dependencies>

 

第一种办法,把jasper的作用域 改为 <scope> provided </scope>

 

第二种办法,点击主应用(这里取名为maven),mvn插件运行 mvn spring-boot:run     (中间有冒号),需要在pom里有maven的plugin

<build>
        <plugins>

            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>


                </configuration>
            </plugin>

        </plugins>
    </build>

 

posted @ 2022-03-29 16:16  琴声清幽  阅读(432)  评论(0编辑  收藏  举报