Hi Axel,
I understand your frustration not being able to return a Route object
from a file upload servlet, but I cannot see why, having just slogged
through downloading a 1MB binary, you want to struggle through orders
of magnitude greater slog trying to upload it again to the client from
whence it came. I'm not surprised FF objects!
What I would try is to generate an XML string in my file upload
servlet to represent my Route object (easy using, say, dom4j) which
you can stream directly back to client via
HttpServletResponse .getOutputStream(). Then, back on client side...
public void onSubmitComplete(FormSubmitCompleteEvent event) {
// When the form submission is successfully completed, this
event is
// fired. Assuming the service returned a response of type
text/html,
// we can get the result text here
plug said text into the GWT XMLParser to produce a GWT Document from
which you can read your Route object properties. Job done.
Yes I know it's not as convenient and clean as RPC, but hey, when it
comes to HTTP and you're in doubt, sling a bit of XML about. It
doesn't have to conform to anyone's standards but yours.
regards
gregor
On Nov 17, 7:15 pm, Axel <[EMAIL PROTECTED]> wrote:
> Here's the code that seems to be doing the serialization of a byte[]
> object, from
> com.google.gwt.user.client.rpc.core.java.lang.Byte_CustomFieldSerializer:
>
> public static void serialize(SerializationStreamWriter streamWriter,
> Byte instance) throws SerializationException {
> streamWriter.writeByte(instance.byteValue());
> }
>
> and then
> com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter:
>
> public void writeByte(byte fieldValue) {
> append(String.valueOf(fieldValue));
> }
>
> I take it that this creates a new String object for each byte in the
> byte[]. Furthermore, the encoding is a decimal numeric string,
> presumably prefixed with the type code used for the byte type during
> serialization which seems to be the class name ("java.lang.Byte").
> This at least would explain some of the bloat happening. I'll follow
> Matt's advice and will file this as a bug report.
>
> Thanks for all the comments,
> -- Axel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---