springboot靜態資源路徑制定


spring.resources.static-location參數指定了Spring Boot-web項目中靜態文件存放地址,

該參數默認設置為:

classpath:/static,

classpath:/public,

classpath:/resources,

classpath:/META-INF/resources,

servlet context:/ 自定義目錄需要指定

例如:spring.resources.static-locations=

classpath:templates/ resources

目錄下去除后綴 在resources的html目錄下

spring.mvc.view.prefix=/html

后綴為.html

spring.mvc.view.suffix=.html


免責聲明!

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



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