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();
google-app-engine jdo gwt google-cloud-datastore
dhaval Jan 07 '10 at 6:22 2010-01-07 06:22
source share