AndRoid客户端怎样加载服务器盘符下的图片文件
寒雨诺 2015-01-13 10:06:29 java 服务器
String path = ServletActionContext.getServletContext().getRealPath("/WEB-INF/wpets/push/");
logger.info("path--------------"+path);
try
{
String file = UploadFile.uploadFiles(path, request); // 返回的file为文件的全路径
logger.info("file--------------"+file);
Json json = new Json();
json.setImg(file);
response.getWriter.write(JSON.toJsonString(json)); //将文件路径写到android客户端,
} catch (Exception e) {
e.printStackTrace();
}
return SUCCESS;
客户端拿到这个地址显示不了图片!