分类目录

链接

2022 年 3 月
 123456
78910111213
14151617181920
21222324252627
28293031  

近期文章

热门标签

新人福利,免费薅羊毛

现在位置:    首页 > JAVA > 正文
springboot访问静态资源404 —-idea设置问题
JAVA 暂无评论 阅读(105)

springboot 遇到不能访问静态资源的情况

首先springboot 是默认访问static的 引用JS CSS 路径不需要带上static
如果8080直接访问静态资源 404

This application has no explicit mapping for /error, so you are seeing this as a fallback.
出现这种错误 访问controller一般是没问题的 是静态资源没有加载到tomcat中

看了其他帖子有说在properties中配置路径的 其实现在springboot不需要特地配置 默认映射到static了

把Build project automatically这个勾上

————————————————
版权声明:本文为CSDN博主「阿拉斯加的甜虾」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/Chanxiangtian/article/details/105297763

============ 欢迎各位老板打赏~ ===========

本文版权归Bruce's Blog所有,转载引用请完整注明以下信息:
本文作者:Bruce
本文地址:springboot访问静态资源404 —-idea设置问题 | Bruce's Blog

发表评论

留言无头像?