在JSF中刷新上传的图像(显示) [英] Refresh an uploaded image in JSF(to display)
问题描述
我正在开发一个具有图片上传功能的JSF应用程序。我想显示上传的图片。上传工作正常,但当我删除上传的图片并上传新图片时,旧的图片会显示在浏览器中。我在浏览器中键入了图片的链接,但我得到了旧的。我使用相同的文件名,我不想改变它。我怎么能刷新它。 (没有Javascript)。我正在使用Glassfish服务器。 (重新应用应用程序我得到了新的图片,但它不是在线系统的解决方案;))
谢谢。
I'm developing a JSF application which has an image upload function. I'd like to display the uploaded image. The uploading works fine but when I delete the uploaded picture and upload a new one, the old one is displayed in the browser. I typed the link of the picture in the browser but I sill get the old one. I use the same file name and I would not like to change it. How could I refresh it. (without Javascript). I'm using Glassfish Server. (Redeplyoing the application I get the new picture but it isn't a solution for an online system ;)) Thank you.
推荐答案
重新申请申请表我得到了新照片
不要通过 getRealPath()
和consorts将它存储在deploy文件夹中。将它存储在部署文件夹中。
Don't store it in the deploy folder by getRealPath()
and consorts. Store it outside the deploy folder.
- Uploaded image only available after refreshing the page
这篇关于在JSF中刷新上传的图像(显示)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!