【发布时间】:2017-09-26 13:38:29
【问题描述】:
我将图像文件保存到
src/main/webapp/resources/上传
,将图片文件的绝对路径插入数据库,并使用绝对路径显示文件,如下所示:
<td><img src="${content_view.bFilePath}" alt="" style="width:30px;height:30px;" /></td>
仅当我在 Eclipse 中运行项目时才显示图像文件。如果我在浏览器上运行该项目,我不会显示任何图像,并且即使我设置了图像大小,它也会一直显示 img src 0x0。
我都试过了:
<img src="${content_view.bFilePath}" alt="" style="width:30px;height:30px;" />
<img src="${content_view.bFilePath}" alt="" width=100 height=100 />
而我的路径是这样的:
C:\Users\ADMIN\workspace\RankingWeb_v5\src\main\webapp\resources\upload\Koala_20170926-22-36-04.jpg
我没有看到路径有任何问题,因为它在 Eclipse 上显示图像。 我该如何解决这个问题?
【问题讨论】: