在java项目中动态存储图像 [英] Storing Images in java project dynamically
问题描述
我正在用 Java 开发一个网站.
I am working on a website in java.
当我登录该网站时,我有 use_case
从其他网站获取图像并将它们显示在我的网站上.但问题是我不想仅通过存储 URL 来显示图像,因为 URL 可能会更改,在这种情况下图像将不会显示.因此,我想将 URL 作为图像存储或写入某个位置.这样,下次当我登录我的网站时,我将从该位置获取我的图像.
When I login to that website I have use_case
to fetch images from other websites and show them in my website. But the problem is that I don't want to show images by just storing URL, because the URL may change and in that case images won't be displayed. So, I want to store or write the URL as an image in a location. This way, the next time when I login my website, I wll just fetch my image from that location.
所以,我的问题是在哪里存储这些图像.如果我将图像存储在 Tomcat webapps
文件夹中,那么下次构建项目时,该文件夹将被删除.
So, my question is where to store these images. If I store images in Tomcat webapps
folder then next time when I build my project that folder will be deleted.
推荐答案
存储在 tomcat webapps 文件夹中不是一个好方法,也达不到目的.你不能用数据库做同样的事情.并请详细说明我想将 url 作为图像存储或写入某个位置你的意思是什么.
Storing in tomcat webapps folder is not a good approach and will not suffice the purpose. Can't you use database for the same. And please elaborate I want to store or write the url as image in a location what do you mean by that.
这篇关于在java项目中动态存储图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!