GWT cross-domain gotcha

If you're developing GWT on Windows with something other than GWT's own Java code on the server-side (I hit this when using PHP), here's a gotcha for you.

IE allows cross-domain submission of forms. Firefox does not.

So you'll successfully create a FormPanel, click the submit button and have a response show up in 'hosted mode' in IE. But when you compile your application with the GWT compiler and then run it in 'web mode' in Firefox, you get no response.

The solution is simple - just make sure that the www directory (which is where the GWT compiler dumps its output for me) is within your server, and consequently on the same domain as your server-side code and that you access it as such.

1 comment:

Anonymous said...

what the fuck this is?