【发布时间】:2016-04-29 08:24:29
【问题描述】:
我正在尝试检索已存储在我的 tomcat 服务器中的图片,并且我想在我的网页中显示这些图片,但我不知道如何访问或访问它们。 那我该怎么做呢
// upload code from my netbeans project
File f = new File("images/" + name + ".png");
OutputStream outputStream = new FileOutputStream(f);
int read;
byte[] bytes = new byte[1024];
while ((read = inp.read(bytes)) != -1) {
outputStream.write(bytes, 0, read);
}
jsp page <img src="?">
【问题讨论】:
-
tomcat服务器bin文件夹中的图片