当前位置:网站首页>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/"/>

边栏推荐
猜你喜欢

Expressions régulières \ \ B \ \ b compréhension de l'appariement des limites des mots

Outlook client outlook.com mailbox setting method

什么是IMU?

Take you into the world of MySQL mvcc

SolidWorks cannot reference references

数据湖:Apache Hudi简介

MySQL sub database and sub table and its smooth expansion scheme

1. Learn to understand web pages

JS 數組 isAarray() typeof

Hcip day 10 (initial BGP border gateway protocol)
随机推荐
Ugui source code analysis - Mask
The simple use of ADB command combined with monkey is super detailed
C自定义类型详解
Go log package
How to realize software function safety
Ugui source code analysis - imaterialmodifier
Skywalking distributed system application performance monitoring tool - upper
What is the experience of writing concurrent tool classes (semaphore, cyclicbarrier, countdownlatch) by yourself in line 30?
SSM based blog system [with background management]
C user defined type details
Go IO operation - file write
Gpushare. COM | how to use tensorboardx visualization tool?
How to write selenium's testng.xml
移动通信的新定义:R&SCMX500 将提高5G设备的IP数据吞吐量
Jump statement in day011 loop structure
JVM initial
All codes of selenium
MySql的DDL和DML和DQL的基本语法
Qt自定义类使用自定义含参信号与槽
Babylon.js cool canvas background animation JS special effects