[英]How to access images on the local file system directly from a web app?
For example: 例如:
<html>
<body>
<img src="E:\webappimages\ab.jpg">
</body>
</html>
This static page works if it's simply opened with a browser. 如果仅通过浏览器打开此静态页面,则该页面有效。
But if I copy the same html document to src/main/resources/static
directory of a webapp in the eclipse ide
and serve it using tomcat
,Then the image ab.jpg
do not show up in the served webpage. 但是,如果我将相同的html文档复制到eclipse ide
Webapp的src/main/resources/static
目录中,并使用tomcat
投放,则图像ab.jpg
不会显示在所提供的网页中。
How to access images in the file system directly from html
and css
that is part of a webapp & without having to explicitly copy images to src/main/resources/...
directories of the project? 如何直接从Web应用程序的一部分html
和css
访问文件系统中的图像,而不必显式复制图像到项目的src/main/resources/...
目录?
If you want a static resource that everyone can link to, try setting up a developer's account on Amazon S3. 如果您希望每个人都可以链接到静态资源,请尝试在Amazon S3上设置开发人员帐户。 You can add any images you would like to there, generate a public link to them, and reference that link in your image tag. 您可以在其中添加任何想要的图像,为它们生成公共链接,然后在图像标签中引用该链接。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.