idea中springboot靜態資源及頁面跳轉問題


1,靜態資源放在resources/static下,html頁面放在resources/templates下

2,在html中引入靜態資源時,不用帶static(對於路徑來說是透明的)

 

3,

配置html的時候需要使用到其他工具,比如freemarker

spring.freemarker.suffix=.html

spring.freemarker.template-loader-path=classpath:/templates/

pom.xml代碼:

 

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

 

 

配置jsp頁面的時候使用

spring.mvc.view.prefix=/WEB-INF/

spring.mvc.view.suffix=.jsp

 


免責聲明!

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



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