Java教程

springboot+JSP时踩的坑

本文主要是介绍springboot+JSP时踩的坑,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

学习动力节点老师的课时,一直不能调试成功,主要有两个地方没修改好
(1)用于解析JSP的配置依赖没有加全

 <!--用于解析jsp页面-->
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-jsp-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>

(2)插件路径没设置好

           <resource>
                <directory>src/main/webapp</directory>
                <targetPath>META-INF/resources</targetPath>
                <includes>
                    <include>**/*.*</include>
                </includes>
            </resource>

            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
            </resource>

            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.*</include>
                </includes>
            </resource>

以上设定后,正常。

这篇关于springboot+JSP时踩的坑的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!