GWT and REST
I've posted two message to the GWT Google Group in the last couple of days. However, new member messages are moderated and neither has shown up yet. I'm reposting my questions here in hopes of getting some answers.
Is there a way to easily use a REST backend with GWT? I tried GWT-REST. It works, but it seems to be centered towards Rails (I'm using Grails) and it suffers from the SOP issue.
JSONRequest looks promising for cross-domain support, but I can't get it to work either. The provided examples work, but not my simple hello world that returns:
{"response":"Hello World!"}
Also, the example implementation only has GET support, not PUT, DELETE or POST. I can post my REST backend on the public internet if anyone is interested in seeing the issues I'm having.
Thanks in advance for any advice.
Posted by Bob Lee on July 21, 2008 at 04:55 PM MDT #
Posted by Dave Copeland on July 21, 2008 at 04:58 PM MDT #
Hi there,
you could try out our (still sandboxed) "thin" REST client for GWT from here: http://svn.sonatype.org/nexus/trunk/sandbox/nexus-gwt-ui/sonatype-gwt-rest/
It is already used in the "next gen" GXT based UI for Nexus. The feature list is not huge, but it works for REST services based on JSON or XML. I started with GWT-REST too, but it's focus on Rails prevented me to implement proper requests against restlet.org powered Nexus (ie. not supporting every HTTP method).
Posted by Tamas Cservenak on July 21, 2008 at 05:00 PM MDT #
> The code you posted looks like it's for JSONP. You probably want XmlHttpRequest, so check out RequestBuilder.
I'm using Grails' JSON Builder to produce this JSON, but it's certainly possible it sucks.
As far as RequestBuilder, its javadoc indicates it only supports GET and POST. Also, I believe it suffers from the SOP issue as well, doesn't it?
Posted by Matt Raible on July 21, 2008 at 05:10 PM MDT #
Posted by Bob Lee on July 21, 2008 at 05:24 PM MDT #
Posted by Bob Lee on July 21, 2008 at 05:29 PM MDT #
Posted by Jerome Louvel on July 23, 2008 at 10:34 AM MDT #
@Tamas: I checked out sonatype-gwt-rest and when I ran "mvn package", I got the following error:
Do I need to checkout the source for Nexus and mvn install it to get sontatype-gwt-rest to compile?
Also, it looks like SOA Faces might be something similar. Have you looked at it? It sounds like a JSF library, but it appears to be geared towards GWT.
Posted by Matt Raible on July 23, 2008 at 12:18 PM MDT #
Posted by Tamas Cservenak on July 23, 2008 at 12:26 PM MDT #
Posted by Jerome Louvel on July 25, 2008 at 12:33 PM MDT #
Restlet-GWT module announce
Usage documentation
Posted by Jerome Louvel on July 25, 2008 at 12:35 PM MDT #
Posted by jmus on December 14, 2008 at 10:43 PM MST #
Hi jmus,
It is easily feasible using a Restlet Redirector on the server-side (like a reverse proxy) as illustrated in figure 4 of this page:
http://wiki.restlet.org/docs_1.1/13-restlet/144-restlet/185-restlet.html
But maybe you are looking at removing the SOP on the browser itself? I'm not sure it is feasible in a cross-browser compatible way...
http://en.wikipedia.org/wiki/Same_origin_policy
Best regards,
Jerome
Posted by Jerome Louvel on December 18, 2008 at 11:04 PM MST #
Posted by Hiram Chirino on November 16, 2009 at 02:59 PM MST #