Cannot get image data in gwt google datastore - image crossed out

I have a class in which I decrlared a serialized class for storing image data

@Persistent(serialized = "true") private DownloadableFile imageLogoFile; 

Class implementation

 public class DownloadableFile implements Serializable { 

public DownloadableFile (byte [] content, String filename, String mimeType) {super (); this.content = content; this.filename = file_name; this.mimeType = mimeType; } private static final long serialVersionUID = -8497358622042084708L; private byte [] content; private String filename; private String mimeType; public DownloadableFile () {}}

showlogo is a servlet that should receive content from a data store, but all of its calls return null, while blob is displayed in the application.

The place where image data was expected to be

 final Image logoImage = new Image(); logoImage.setUrl("/showlogo"); logoImage.setHeight("100px"); logoImage.setWidth("100px"); 

Edit: Now image data is saved and retrieved, but the image is stretched. I tried to give height / width, etc.,

Servlet Code:

 com.sms.DownloadableFile df = w.getImageLogoFile(); if (df != null){ String filen = df.getFilename(); response.setHeader("Content-Disposition", "filename="+filen); String mime = df.getMimeType(); response.setContentType(mime); byte[] b = df.getContent(); //Base64.encode(b); response.setContentLength(b.length); ServletOutputStream out = response.getOutputStream(); out.write(b); // Pipe data here out.flush(); out.close(); } 
0
google-app-engine jdo gwt google-cloud-datastore
Jan 07 '10 at 6:22
source share
1 answer

and you did not put this field in the selection group, so it is not retrieved.

+1
Jan 07 '10 at
source share
— -



All Articles