我用ajax+struts2將文件上傳到了項(xiàng)目下的指定路徑,在不刷新頁(yè)面的情況下無(wú)法正常顯示圖片,有什么解決辦法嗎?求大佬指點(diǎn)。
閉關(guān)修行中......
It is best to rename the image path saved on the server, otherwise there will be caching problems.
After ajax uploads the image, the server generates the path name and returns it to the front desk. The front desk then sets a new image path.
The image saved to the server needs to have a unique name, then return the full path of the image to ajax, and then modify the attributes that need to be echoed
You can use the returned path to try it directly in the browser. If it works in the browser, then the page will also work