|
-
May 14th, 2010, 09:53 AM
#1
Image Object Displayed in HTML
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!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|