我正在使用GWT RPC。我在從SQL中檢索圖像時遇到問題。 這裏是我的代碼:在GWT中從我的sql中檢索圖像
Base64 bas = new Base64();
// sun.misc.BASE64Encoder enc = new sun.misc.BASE64Encoder();
UploadfileJpaController up = new UploadfileJpaController();
// this function returns the value in blob field in the form of byte array
byte[] b = up.findUploadfile(n);
String base64Contents = enc.encode(b).replaceAll("\\s+", "");
//String base64 = Base64Utils.toBase64(b);
base64Contents = "data:image/gif;base64,"+base64Contents;
return base64Contents;
但這不是工作..不顯示圖像。請幫忙:(
其中是試圖顯示圖像的客戶端代碼? – Dojo 2012-04-03 13:34:35