Refresh an uploaded image in JSF(to display)

社会主义新天地 提交于 2019-12-12 01:32:21

问题


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.


回答1:


Redeplyoing the application I get the new picture

Don't store it in the deploy folder by getRealPath() and consorts. Store it outside the deploy folder.

See also:

  • Uploaded image only available after refreshing the page


来源:https://stackoverflow.com/questions/9674580/refresh-an-uploaded-image-in-jsfto-display

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!