当前位置:网站首页>idea写web项目时报错Failed to load resource: the server responded with a status of 404 (Not Found)
idea写web项目时报错Failed to load resource: the server responded with a status of 404 (Not Found)
2022-07-24 03:20:00 【崔泡泡—猫】
今天用idea写项目时发现页面的css文件和js文件都没有加载出来,按F12查看控制台查看报错

首先检查idea中项目配置路径是否出错
可以看到路径是正确的,接着查看浏览器是否能够将css文件和js文件读取出来

可以看到虽然能找到这个文件,但是文件内容是空的,这说明这个文件并不是我们放在idea中的css文件,而是根据路径自动生成的,说明idea在扫描静态资源(js,css,images)时出现了差错
检查springmvc中是否有关于扫描静态资源的代码,发现没有

添加代码,问题解决
<!-- 静态资源处理 css js imgs -->
<mvc:resources mapping="/sources/**" location="/sources/"/>

边栏推荐
- What is the security of Treasury reverse repo
- Xiaodi and Xiaohui
- Connected graph (day 72)
- Take you into the world of MySQL mvcc
- Gpushare.com | 如何使用TensorBoardX可视化工具?
- Ugui source code analysis - maskutilities
- 198. House raiding
- Correct usage of iota in golang
- Test interview questions
- C user defined type details
猜你喜欢

Hcip day 10 (initial BGP border gateway protocol)

C文件操作详解

LCD1602 - binge 51

What is the experience of writing concurrent tool classes (semaphore, cyclicbarrier, countdownlatch) by yourself in line 30?

Gpushare.com | 如何使用TensorBoardX可视化工具?

Ugui source code analysis - Mask

JS Array isaarray () Type of

SolidWorks CAM data cannot be recovered because a processed part has been detected.

C自定义类型详解

IO流分类整理
随机推荐
The new idea 2022.2 was officially released, and the new features are nice
Binary tree traversal (day 74)
关于Aries框架增删改查-查Demo
Some properties of differential array operation
在openEuler社区开源的Embedded SIG,来聊聊它的多 OS 混合部署框架
Industrial controller, do you really know your five insurances and one fund?
微信公众号在线客服接入发方法和功能详解
Talk about the application of FIFO
Open source embedded sig in the openeuler community. Let's talk about its multi OS hybrid deployment framework
Cannot resolve symbol 'override' of idea clone‘
数据湖:Apache Hudi简介
C动态内存管理详解
go errors
Detailed explanation of wechat official account online customer service access methods and functions
C自定义类型详解
Qt自定义类使用自定义含参信号与槽
The simple use of ADB command combined with monkey is super detailed
Programmers may still be programmers, and coders may only be coders
MariaDB related instructions
How to implement desktop lyrics in pyqt