解決SpringBoot總是找不到jsp


添加四個坐標

<dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
            <!--<scope>provided</scope>-->
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>

 

 

目錄結構

 

 

application.properties配置視圖解析器

 

 

 

 

寫一個控制器提供跳轉

 

設置 工作路徑為$MODULE_DIR$,右側的下拉選可以選

 

如果沒有該選項,選擇本項目

 

 

運行成功

 

 

 

 

參考https://blog.csdn.net/chuan8898439/article/details/82958903



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM