页面
<img src="${ctx}/xx/xxxx/testImgUrl">
2.后台
@RequestMapping("/testImgUrl")
public void testImgUrl(HttpServletRequest request,HttpServletResponse response) throws IOException {
//FileInputStream fis = null;
InputStream fis = null;
OutputStream os = null;
URL url = null;
HttpURLConnection httpUrl = null;
try {
url = new URL("/img/");//远程图片地址
httpUrl = (HttpURLConnection) ();
();
//fis = new FileInputStream("d:/img/");//本地图片地址
fis = ();
os = ();
int count = 0;
byte[] buffer = new byte[1024 * 8];
while ((count = (buffer)) != -1) {
(buffer, 0, count);
();
}
} catch (Exception e) {
();
} finally {
try {
();
();
();
} catch (IOException e) {
();
}
}
}
3.上传文件到远程的文件服务器,待续,,,,,,,,,,