简体   繁体   English

图像和JSP问题

[英]Problem with images and JSP

I am not able to see any images in my JSP page. 我的JSP页面中看不到任何图像。 I get the error 我得到错误

Resource interpreted as image but transferred with MIME type text/html. 资源被解释为图像,但以MIME类型text / html传输。

What does it mean? 这是什么意思? What is solution? 什么是解决方案?

The response you have sent to browser contains MIME type as text/html but you have transferred image data. 您发送到浏览器的响应包含MIME类型为text/html但是您已经传输了图像数据。

If you are sending image by response.write(..); 如果您通过response.write(..)发送图像; from servlet or producing it from jsp make sure its MIME type should be Content-type: image/png [png if format is png , jpg . 从servlet或从jsp生成它,请确保其MIME类型应为Content-type: image/png [png,如果format为png,jpg。 . refer more and choose appropriate] 参考更多并选择合适的]

It means that the client requested what it thought was an image and received what the server claimed was an HTML document. 这意味着客户端请求了它认为是图像的内容,并收到了服务器声称的HTML文档。

I suspect that: 我怀疑:

  • You have the wrong URLs for the images and 您的图片网址错误,并且
  • The servers 404 Not Found error page is being sent with a 200 OK status code. 正在使用200 OK状态代码发送服务器404 Not Found错误页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM