yellabuff
May 14th, 2010, 09:53 AM
I am trying to display an image in the browser from the backend. The code I have is...
response.setContentType("image/jpeg");
OutputStream osResponse = response.getOutputStream();
osResponse = response.getOutputStream();
BufferedImage biNew = new BufferedImage(200, 200, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = biNew.createGraphics();
g.drawImage(form.getEmpImage(), null, null);
ImageIO.write(biNew, "jpg", osResponse);
osResponse.flush();
osResponse.close();
return null;
form.getEmplmage() is defined as....
private Image empImage;
I don't get any errors but nothing displays in the browser.
This is the first time I've had to do anything like that so I'm at a total loss....
Please help!
response.setContentType("image/jpeg");
OutputStream osResponse = response.getOutputStream();
osResponse = response.getOutputStream();
BufferedImage biNew = new BufferedImage(200, 200, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = biNew.createGraphics();
g.drawImage(form.getEmpImage(), null, null);
ImageIO.write(biNew, "jpg", osResponse);
osResponse.flush();
osResponse.close();
return null;
form.getEmplmage() is defined as....
private Image empImage;
I don't get any errors but nothing displays in the browser.
This is the first time I've had to do anything like that so I'm at a total loss....
Please help!