Springboot学习(五) ---- 静态资源访问

Springboot学习(五) ---- 静态资源访问

1.SpringBoot从classpath/static 的目录下查找”:
注意: 目录名称必须为:static
启动项目 : 直接访问:
eg:
localhost:8080/xxx.jpg --访问static下放置的图片。
如果存放在static下的某个目录:就在需要访问的文件前加目录

2.ServletContext根目录下进行查找:
在这里插入图片描述

原创文章 25 获赞 10 访问量 1万+

猜你喜欢

转载自blog.csdn.net/weixin_42195162/article/details/94979137
今日推荐