引用java图片下载代码
class="java" name="code">
try {
String urlInfo = new String(this.getRequest().getParameter("urlInfo").getBytes("iso-8859-1"), "utf-8");
File file = new File(urlInfo);
FileInputStream fis = new FileInputStream(file);
BufferedInputStream buff = new BufferedInputStream(fis);
byte [] b = new byte[1024];
long k=0;
ServletOutputStream myout = ServletActionContext.getResponse().getOutputStream();
while(k < file.length()){
int j = buff.read(b,0,1024);
k+=j;
myout.write(b,0,j);
}
myout.flush();
myout.close();
} catch (IOException e) {
e.printStackTrace();
}