Tomcat不返回图像资源 [英] Tomcat doesn't return image resources

查看:88
本文介绍了Tomcat不返回图像资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用eclipse并使用eclipse中的tomcat6运行我的jsp / servlet。我的servlet为我创建了一个图像,我将其存储到我的webapps中的目录中。但是,当我尝试从我的JSP访问此图像时,它返回我该资源不可用。

I'm using eclipse and run my jsp/servlet using tomcat6 from eclipse. My servlet creates for me an image that i store in to a directory in my webapps. But when i try to access to this image from my JSP it returns me that the resource is not available.

有什么问题?

myapp / images / saved.png中的Servlet商店图片

Servlet store image in "myapp/images/saved.png"

推荐答案

您需要移动 images 目录进入 WebContent 目录。这将使它发挥作用。

You need to move the images directory into the WebContent directory. That will make it work.

这篇关于Tomcat不返回图像资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆