springboot设置访问静态资源目录

在application.properties方文件中添加如下代码:(把static改成自己允许访问的文件夹名字即可)

#设置允许访问静态static目录
spring.mvc.static-path-pattern=/static/**
springg.resources.static-location=classpath:/static/

发布了33 篇原创文章 · 获赞 23 · 访问量 6611

猜你喜欢

转载自blog.csdn.net/weixin_40516924/article/details/103020677