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