Hi, I tried to use your solution. Looking at Google I/O on youtube (
http://www.youtube.com/watch?v=NNmoEOpGJdk) I saw this but I wasn't able to do it.
I tried creating this:
public class BinaryXMLHttpRequest extends XMLHttpRequest
{
public native JavaScriptObject getResponse()
/*-
{
return this.response;
}
-*/;
//Set to "arraybuffer" or "blob" for binary response
public native void setResponseType(String value)
/*-
{
this.responseType = value;
}
-*/;
}
then I used this class this way:
BinaryXMLHttpRequest binxhr = (BinaryXMLHttpRequest)BinaryXMLHttpRequest.create();
binxhr.open("GET", "myservlet_url");
binxhr.setResponseType("arraybuffer");
binxhr.setOnReadyStateChange(new ReadyStateChangeHandler()
{
@Override
public void onReadyStateChange(XMLHttpRequest xhr)
{
BinaryXMLHttpRequest binxhr = (BinaryXMLHttpRequest)xhr;
if( binxhr.getReadyState() == XMLHttpRequest.DONE )
{
binxhr.clearOnReadyStateChange();
binxhr.getResponse(); => what can I do with this?
}
}
});
If you look, at the end I have a binxhr.getResponse(); But this function returna a JavaScriptObject type. What can I do now with this? This is not a byte[] or whatever, so, I don't know in GWT how to manipulate it. Do you have an idea?