1.创建配置类文件夹,并创建配置类;

2.config类实现 WebMvcConfigurer 类,并重写 addResourceHandlers方法

3.运行项目,浏览器输入静态资源文件地址即可访问。

1.创建配置类文件夹,并创建配置类;
2.config类实现 WebMvcConfigurer 类,并重写 addResourceHandlers方法
3.运行项目,浏览器输入静态资源文件地址即可访问。
本文标题:SpringBoot项目配置自定义静态资源文件路径
本文链接:https://www.haomeiwen.com/subject/acbyektx.html
网友评论