Failed to load resource: the server responded with a status of 404 ()

Did not parse stylesheet at ‘http://localhost:8080/css/xxx.css’ because non CSS MIME types are not allowed in strict mode.

Failed to load resource: the server responded with a status of 404 ()

如何解决【后端解决】
// response.setContentType("text/html;charset=utf-8");

// 调整成下面的方式
String contentType = request.getHeader("Accept");
response.setContentType(contentType == null ? "text/html;charset=utf-8" : contentType + ";charset=utf-8");
  • 后端更新代码后,重启服务。
  • 前端需要将浏览器缓存清理干净,重启浏览器重新复测。
报错原因

设置过滤的字符编码导致了前端网页中的css失效。

后端通过对比下图可得知问题所在

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
根据引用和引用中提供的信息,当遇到"Failed to load resource: the server responded with a status of 404 (Not Found)"错误时,有两个可能的原因。 首先,根据引用中的经验,这个错误可能是因为db.json文件的位置不正确导致的。请确保db.json文件位于正确的位置,以便服务器可以找到它并加载数据。 其次,根据引用中的解释,这个错误还可能是因为路径有问题导致的。在使用dynamics提供的webapi进行查询时,需要注意实体名的命名规则。实体名以"s"结尾时,在查询时需要将"s"替换为"es"。而以"y"结尾的实体名,则需要将"y"替换为"ies"。其他情况下,只需要在实体名后面加上"s"即可。请确保在查询数据时,实体名的命名和路径设置正确。 综上所述,当出现"Failed to load resource: the server responded with a status of 404 (Not Found)"错误时,您应该检查db.json文件的位置以及路径是否正确。<span class="em">1</span><span class="em">2</span> #### 引用[.reference_title] - *1* [Failed to load resource: the server responded with a status of 404 (Not Found)](https://blog.csdn.net/m0_56438452/article/details/125470911)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [错误:Failed to load resource: the server responded with a status of 400 (Bad Request)](https://blog.csdn.net/qq_60521457/article/details/119957664)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值