Barry
Barry

Reputation: 1665

GWT RequestBuilder

How do i use GWT Request builder to pass on a String from my GWT code to a website www.xyz.com.It would be greatly helpful if i can get the code for doing this.

Thanks

Upvotes: 3

Views: 979

Answers (2)

Igor Klimer
Igor Klimer

Reputation: 15331

If you want to just send a string, then you can do something simple like add an Image/<img> with src pointing to www.xyz.com + the string you want to send - the src won't be pointing to an image actually (of course), it's just that you can sidestep SOP (Same Origin Policy). Of course, you have to handle the requests for "the image" appropriately on www.xyz.com (and make sure the broken image is hidden/not shown on the client side).
Anyway, that's the basic idea - a <script> tag would work too.

Upvotes: 2

Jason Hall
Jason Hall

Reputation: 20930

In order to make cross-domain XHR requests, you need to use JsonpRequestBuilder, which is pretty well documented in its comments.

Feel free to ask a more specific question if you encounter any specific problems.

Upvotes: 1

Related Questions