Unable to Retrieve Json from Other Domains in Development Mode

12 views
Skip to first unread message

pongad

unread,
Jul 11, 2011, 5:21:39 AM7/11/11
to Google Web Toolkit
Hi all,
I got started with GWT a while ago and currently trying to get my
web app to communicate with a server. The "standard" way to get JSON
from server illustrated in the tutorial is to create a servelet.
However I already have a server running and I (understandably) don't
really want to port the whole server.
I have this idea that I will just run the app in development mode
(so the ui and javascript comes from the development mode server) and
just make my program send requests for Json's to my server (which is
running on the same machine) . For some reason, the requests were
successful (I configured the server to write the response into
terminal), but the app did not receive the response. I made it print a
diagnosis message every time the request-Json code is run and it tells
me that the response header is 0 and there is no content
(response.getText() == ""). In addition, when I compiled the code into
production mode, the Json's work perfectly.
Is it a conscious design choice to make apps in development mode
ignore messages from other server? A bug? Or, most likely, did I make
any stupid mistake?

Thanks all,
Michael

Thomas Broyer

unread,
Jul 11, 2011, 5:28:15 AM7/11/11
to google-we...@googlegroups.com
You might be hitting the Same Origin Policy. In your case though, you should be able to just run the DevMode in -noserver mode: http://code.google.com/webtoolkit/doc/latest/DevGuideCompilingAndDebugging.html#How_do_I_use_my_own_server_in_development_mode_instead_of_GWT's
Reply all
Reply to author
Forward
0 new messages