简体   繁体   English

访问工作空间\\.metadata\\.plugins\\org.eclipse.wst.server.core\\tmp0\\wtpwebapps\\中的文件

[英]Access files inside workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\

I have a spring web project which basically Test webApp and capture screenshot of pages.我有一个spring web 项目,它基本上测试 webApp 并捕获页面的屏幕截图。 The path of the saved image looks something like below:保存图像的路径如下所示:

"\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
 \Demo\WEB-INF\Results\Test\1118015800\error\error_ST001_1.jpg"

I am trying to display the saved image on a JSP page and so far success has been elusive.我正在尝试在 JSP 页面上显示保存的图像,但到目前为止还没有成功。 I tried different combination of relative path also I tried to give absolute path but it doesn't work.我尝试了相对路径的不同组合,我也尝试给出绝对路径,但它不起作用。 My image tag looks something like this我的图像标签看起来像这样

<img src="<c:url value="/WEB-INF/Results/Test/1118015800/error/error_ST001_1.jpg" />" />

Does anyone have any idea on displaying the image?有没有人对显示图像有任何想法? Could it be because files are stored inside the .metadata folder of Eclipse workspace that I am not able to display any image?可能是因为文件存储在 Eclipse 工作区的 .metadata 文件夹中,我无法显示任何图像?

This is because the WEB-INF directory is special.这是因为WEB-INF目录比较特殊。 The web container won't serve files from that location - that behavior is defined in the Servlet Spec. Web 容器不会从该位置提供文件 - 该行为在 Servlet 规范中定义。

You can either create a servlet that takes requests from the client, loads images (eg using getResourceAsStream() ) and streams them back, or move the images to a different place in your web app hierarchy.您可以创建一个 servlet 来接受来自客户端的请求、加载图像(例如使用getResourceAsStream() )并将它们流式传输回来,或者将图像移动到 Web 应用程序层次结构中的不同位置。

暂无
暂无

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

相关问题 IllegalArgumentException:文档库\\ .metadata \\ .plugins \\ org.eclipse.wst.server.core \\ tmp0 \\ wtpwebapps不存在或不是可读目录 - IllegalArgumentException: Document base \.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps does not exist or is not a readable directory 无法删除 /.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/appname/WEB-INF/lib。 可能被另一个进程锁定 - Could not delete /.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/appname/WEB-INF/lib. May be locked by another process 我可以创建 websphere 服务器实例并使用 org.eclipse.wst.server.core 插件进行配置吗? - Can i create websphere server instance and configure using org.eclipse.wst.server.core plugin? 关于Java中Web应用程序的“org.eclipse.wst.server.core”文件夹的一般问题很少 - Few general questions about “org.eclipse.wst.server.core” folder of a web application in Java Program Files \\ Eclipse \\ plugins,〜/ .eclipse / org.eclipse。* / plugins和〜/ workspace / .metadata / .plugins之间有什么区别? - What is the difference between Program Files\Eclipse\plugins, ~/.eclipse/org.eclipse.*/plugins, and ~/workspace/.metadata/.plugins? 找不到org.eclipse.wst.server.core.serverTypes扩展点的架构 - No schema found for the org.eclipse.wst.server.core.serverTypes extension point Eclipse无法解析插件org.eclipse.wst.server.ui - Eclipse unable to resolve plugin org.eclipse.wst.server.ui 无法为&#39;/ myProject&#39;写元数据。(D:\\ Programming \\ Java \\ .metadata \\ .plugins \\ org.eclipse.core.resources \\ .projects \\ myProject \\ .ma - Could not write metadata for '/myProject'.(D:\Programming\Java\.metadata\.plugins\org.eclipse.core.resources\.projects\myProject\.ma 什么是org.eclipse.wst.common.component以及如何将它用于ant - what is org.eclipse.wst.common.component and how to use it for ant 在 SWT 对话框中嵌入 org.eclipse.wst.sse.ui.StructuredTextEditor - embed org.eclipse.wst.sse.ui.StructuredTextEditor in SWT Dialog
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM