SpringBoot-----SpringBoot访问静态资源
文章目录
??一、静态资源相关目录
SpringBoot项目中没有WebApp目录,只有src目录。在src/main/resources下面有static和templates两个文件夹。SpringBoot默认在static目录中存放静态资源,而templates中放动态页面。
1、static目录
SpringBoot通过/resources/static目录访问静态资源,在resources/static中编写html页面:
2、templates目录
在SpringBoot中不推荐使用JSP作为动态页面,而是默认使用Thymeleaf编写动态