首页 > 编程语言 > 详细

Spring Boot 访问静态资源

时间:2020-05-08 21:53:51      阅读:52      评论:0      收藏:0      [点我收藏+]


在SpringBoot 项目中没有我们之前常规web 开发的WebContent(WebApp),它只有
src 目录。在src/main/resources 下面有两个文件夹,static 和templates。SpringBoot 默认在static
目录中存放静态页面,而templates 中放动态页面。
1 static 目录
Spring Boot 通过classpath/static 目录访问静态资源。注意存放静态资源的目录名称必须
是static。
2 templates 目录
在Spring Boot 中不推荐使用jsp 作为视图层技术,而是默认使用Thymeleaf 来做动态页
面。Templates 目录这是存放Thymeleaf 的页面。

Spring Boot 访问静态资源

原文:https://www.cnblogs.com/zhengjinsheng/p/12853059.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!