ServletOutputStream out = response.getOutputStream();
//获取服务器上的图片
String realPath = this.getServletContext().getRealPath("服务器图片路径");
InputStream in = new FileInputStream(realPath);
int len = 0;
byte[] buffer = new byte[1024];
while((len= in.read(buffer))>0){
out.write(buffer,0,len);
}
in.close();
out.close();