View Single Post
  #1 (permalink)  
Old August 8th, 2007, 09:40 AM
mahendra.w mahendra.w is offline
Registered User
 
Join Date: Aug 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default display byte array of jpeg in jsp

Hi All,please give me your solution, thanks.

i have a dvo where it consist of byte array of a picture. while trying to display on jsp ,i could not get the picture.
here is the code i tried

 response.setContentType("image/jpeg");
 OutputStream outSt = response.getOutputStream();
 outSt.write(loDocumentDVO.getFileContents());
  // where loDocumentDVO.getFileContents() consist of byte array
 outSt.flush();
 outSt.close();
Reply With Quote