Thursday, September 1, 2011

Re: Seperating the hosting of the client and server



On Thursday, September 1, 2011 6:07:23 PM UTC+2, Sander Smith wrote:
I'm trying to seperate the client side of my GWT app (the JS files)
from the server side by hosting them in different places. So the
static JS is at www.host1.com and the Java web app stuff is at www.host2.com.
To communicate, I simply pass the fully qualified URL (http://
www.host2.com/...) into setServiceEntryPoint().

Things aren't working, and I don't know why.

"Same Origin Policy"
 
I've looked through the
documentation to see if this is allowed, and can't find anything that
says it's not. I have a gut feeling that this is violating some sort
of JS security issue, so I wanted to check before continuing.

Am I able to do what I want?

If your HTML host page is on host1, then you won't be able to use GWT-RPC, RequestFactory or RequestBuilder to communicate with host2 (well, that's not entirely true, but if IE is to be supported, then consider it's simply not possible).

You can however deploy your HTML host page on host2 and your JS at host1. You'll have to use the "xsiframe" linker for your code to be loaded in the web page though, but it's as easy as adding a line to your gwt.xml:
<add-linker name="xsiframe" />

--
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/-/YZ5pS1lfFUEJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment