Java过滤器引发的异常:Resource interpreted as Stylesheet but transferred with MIME type text/html

 关于这个问题,

分析原因: 应该是Chrome去服务器拉取资源时,被Filter拦截了请求,未能获取到资源,从而导致了上面所说的比较诡异的错误。

filter能够拦截所有的请求:  无论是css, js,  servlet, 还是其他请求。

解决方法: 在web.xml中排除对.css和.js的请求拦截,或者在doFilter()方法中 过滤css,js的拦截请求。

参考: http://bsr1983.iteye.com/blog/2246994

http://blog.163.com/java__c/blog/static/222749103201310592127616/

猜你喜欢

转载自www.cnblogs.com/alisonGavin/p/8979479.html