Get the response back from server as an object from file upload

38 views
Skip to first unread message

sreenivas

unread,
Nov 20, 2012, 8:40:50 AM11/20/12
to google-we...@googlegroups.com
Hi Geeks,

I am able upload the file to the server and construct the object that is required from file contents , but I am not getting how to send this object back to the client which invoked upload function. My service method is public void service(httpRequest, httpResponse). How can i send this object back to the client. Can somebody please help?

Thanks,
Sreenivas

Thad

unread,
Nov 20, 2012, 2:58:03 PM11/20/12
to google-we...@googlegroups.com
File upload is a servlet, not an RPC call. As such all it can return is html/text.

In my applications, I store the File object or whatever object I parsed the file into in a session attribute. The servlet returns "OK" from a successful file upload or a text error message--maybe an Exception message--to my client. The SubmitComplete method reads the string. If it's "OK" I call an RPC method to retrieve the object.

sreenivas putta

unread,
Nov 20, 2012, 11:53:21 PM11/20/12
to google-we...@googlegroups.com
So, You say it is not possible to return object to the same client in the same call where we are calling for file upload? you are saying after file successful submission, again i need to make another RPC call to get the object back constructed from file contents, is it? But the problem is i have several hosts as server. I submit form to one host and when i want to retrieve the file contents to create my object through an RPC call, I may hit other host, which returns file not found exception, as it is trying to do RPC call on other host. How to resolve this then?

-sreenivas

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/3lE-2NrxEKMJ.

To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

sreenivas

unread,
Nov 21, 2012, 3:56:35 AM11/21/12
to google-we...@googlegroups.com
even the return string is coming as <pre>OK</pre> right? can't i get only the "OK" String?

-sri
Reply all
Reply to author
Forward
0 new messages