1. 问题描述

网页内容正常加载,但是没有样式,而且样式路径是正确的,F12打开控制台看到提示“Resource interpreted as Stylesheet but transferred with MIME type text/html: "**.jsp"”。

2. 解决方案

网上有一些博客提到这个错误是因为ContentType设置为“text/html”导致的,但是这个问题,后面还有一串提示是和jsp相关,所以我的问题不是因为ContentType,最后经过搜索以及筛选,确定这个问题是过滤器将特定目录下的所有资源拦截,但我们其实只是想拦截该目录的html文件和servlet请求。所以我们需要在过滤器中将js、css等其它文件放行,过滤器简单代码如下。

3. 新出现的问题

这样的话,某些js脚本是不是突破拦截,直接访问后台,这个还有待评估。

Resource interpreted as Stylesheet but transferred with MIME type text/html: “**.jsp“,主要因为拦截器将所有资源拦截相关推荐

  1. 【SpringBoot】浏览器报错Resource interpreted as Stylesheet but transferred with MIME type text/html

    CSS 样式不能正常加载 发现页面的样式没有显示,报错信息如下: Resource interpreted as Stylesheet but transferred with MIME type t ...

  2. 【JavaWeb】已解决:Resource interpreted as Stylesheet but transferred with MIME type text/html

    跑了一下两个月之前写的项目,结果出现: 是因为Filter过滤器误伤到了css,注释掉就好了.

  3. CSS文件未加载浏览器报警告:Resource interpreted as Stylesheet but transferred with MIME type text/html...

    JavaWeb项目中CSS样式丢失 问题:bootstrap.css未完成加载,但响应正常 错误定位:filter过滤器写了一句response.setContentType("text/h ...

  4. Resource interpreted as Stylesheet but transferred with MIME type application/x-css

    用tornado做了一个简单的页面.结果页面中的css被加载了,但是没有效果.用谷歌浏览器调试,说是Resource interpreted as Stylesheet but transferred ...

  5. Resource interpreted as Script but transferred with MIME type text/plain:

    我用script做ajax跨域,请求返回的是个文本字符串,chrome提示: Resource interpreted as Script but transferred with MIME type ...

  6. 关于错误Resource interpreted as Script but transferred with MIME type text_html

    Created by Jerry Wang, last modified on Aug 03, 2014 某ui component里的javascript不work,通过Chrome F12 Con ...

  7. easyui提交form数据显示Resource interpreted as Document but transferred with MIME type application/json问题

    今天在用easyui写一个提交表单数据时候,碰到了浏览器提示Resource interpreted as Document but transferred with MIME type applic ...

  8. MIME type (‘text/html‘) is not a supported stylesheet MIME type, and strict MIME checking is enabled

    项目场景: 在index.html中引入一个css文件 问题描述 在index.html中引入一个css文件,报如下错误: Refused to apply style from 'http://lo ...

  9. 【Django】MIME type (‘text/html‘) is not a supported stylesheet MIME type | uWsgi | Nginx

    问题分析 这是浏览器正常的请求类型分析:互联网上的资源有各种类型,通常浏览器会根据响应头的Content-Type字段来分辨它们的类型.例如:"text/html"代表html文档 ...

最新文章

  1. 拿下丰厚的年终奖,却未能拯救总薪酬,2021 年度 IT 薪酬调查报告出炉!
  2. 定义/赋值数组、 expect预期交互
  3. UA MATH571A 一元线性回归II 统计推断2
  4. OpenShift 4 - 安装3Scale API Management环境
  5. gnu java_【Java学习笔记】修饰符
  6. 程序员竟然钟爱这个!我 low了
  7. 深度学习的研究方向: 你会为AI转型么?
  8. 向量-创建数组-linspace/logspace函数
  9. kaggle泰坦尼克号
  10. python常用的颜色英文表达_面料颜色中英文翻译对照表
  11. MSP430F149小系统开发板实现RS232串口通信
  12. 公众号运营,如何快速找到内容定位?
  13. 时间精力管理4象限法
  14. python测验6_测验6: 组合数据类型 (第6周)
  15. 苹果电脑破音的解决办法
  16. Intel oneAPI Base Toolkit 安装教程(Linux)
  17. DataGear 轻松制作支持图表联动的全国地图、省级地图数据可视化看板
  18. 从阿里跳槽来的工程师,写个try catch的方式都这么优雅!
  19. php验证码有图片没数字,php验证码图片不显示
  20. 114 西崖 柳成龍

热门文章

  1. 【转摘】IT人日常的学习—中国消费产业的基本盘和机遇
  2. 【转载】IT新曙光——“遇事不决,量子力学” 的问与答
  3. 详解边缘计算:为何而起、优势如何、哪些玩家以及正在爆发的场景
  4. Smartforms 设置纸张打印格式
  5. 关于自定义程序的效能优化
  6. SAP中和计量单位有关的表
  7. CO-ACT物料分类账
  8. java.lang.NumberFormatException 错误及解决办法
  9. SAP FICO年结
  10. 周休2.5天是一种奢望?互联网人自愿加班成常态?