关于SpringBoot静态资源路径管理问题
作者:什么都干的派森 时间:2022-12-04 03:51:29
一、默认静态资源路径
类路径下:
static
public
resources
这几个目录为默认静态资源访问的目录
二、增加静态资源路径前缀
动态资源和静态资源路径重复时会优先访问动态资源,为了避免路径重复,可以为静态资源路径增加前缀
1.目录结构
2.配置文件
spring:
mvc:
static-path-pattern: /static_path/**
3.访问结果
来源:https://blog.csdn.net/weixin_43721000/article/details/124962868
标签:SpringBoot,静态资源,路径
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Mybatis 动态表名+Map参数传递+批量操作详解
2023-04-02 04:08:00
![](https://img.aspxhome.com/file/2023/1/92631_0s.jpg)
Android 实现左滑出现删除选项
2021-05-28 12:05:59
![](https://img.aspxhome.com/file/2023/1/88661_0s.png)
Android 调用系统应用的方法总结
2023-05-05 09:53:52
Android实现毛玻璃效果的对话框
2021-07-19 03:28:42
![](https://img.aspxhome.com/file/2023/8/94258_0s.png)
Android编程自定义View时添加自己的监听器示例
2023-08-20 11:58:27
![](https://img.aspxhome.com/file/2023/8/110698_0s.png)
Android使用开源组件PagerBottomTabStrip实现底部菜单和顶部导航功能
2023-07-02 11:32:40
![](https://img.aspxhome.com/file/2023/8/138008_0s.png)
Android中通过Notification&NotificationManager实现消息通知
2023-01-01 16:57:05
![](https://img.aspxhome.com/file/2023/7/90187_0s.png)
java迷宫算法的理解(递归分割,递归回溯,深搜,广搜)
2022-10-22 10:36:31
![](https://img.aspxhome.com/file/2023/1/72901_0s.png)
Java中的相除(/)和取余(%)的实现方法
2022-08-27 21:18:02
datatables 带查询条件java服务端分页处理实例
2023-12-24 08:48:16
Spring Cloud Gateway 记录请求应答数据日志操作
2021-12-27 07:25:53
![](https://img.aspxhome.com/file/2023/3/94193_0s.jpg)
springboot+vue制作后台管理系统项目
2022-02-26 06:08:37
![](https://img.aspxhome.com/file/2023/4/69654_0s.png)
Android 调用系统照相机拍照和录像
2023-10-30 05:40:35
详解Java读取Jar中资源文件及示例代码
2021-07-12 11:18:52
WebSocket实现Web聊天室功能
2023-11-27 06:10:52
![](https://img.aspxhome.com/file/2023/9/60189_0s.jpg)
Android中Spinner(下拉框)控件的使用详解
2021-08-09 01:46:28
![](https://img.aspxhome.com/file/2023/3/139123_0s.jpg)
SpringBoot框架集成ElasticSearch实现过程示例详解
2023-02-02 08:44:05
![](https://img.aspxhome.com/file/2023/7/70487_0s.png)
Java数据结构超详细分析二叉搜索树
2022-12-01 01:34:20
![](https://img.aspxhome.com/file/2023/3/61023_0s.jpg)
关于spring boot中几种注入方法的一些个人看法
2022-09-07 10:15:14
Android中仿IOS提示框的实现方法
2023-01-06 15:47:07
![](https://img.aspxhome.com/file/2023/3/138213_0s.png)