0
我跟隨此guide瞭解如何顯示來自blob字段的圖像。如何顯示blob字段的圖像
Blob image = null;
byte[ ] imgData = null ;
// here i get the blob and i'm sure that 'image' is not null //////////
image = rsListaNews.getBlob("immagine_principale");
imgData = image.getBytes(1,(int)image.length());
response.setContentType("image/jpg");
OutputStream o = response.getOutputStream();
o.write(imgData);
o.flush();
o.close();
我得到這個錯誤
org.apache.jasper.JasperException: org.apache.jasper.JasperException: An exception occurred processing JSP page /Include/Chiusura.jsp at line 70
67:
68: response.setContentType("image/jpg");
69:
70: OutputStream o = response.getOutputStream();
71:
72: o.write(imgData);
73:
接收字節數組中的圖像 –