I had a configuration problem in my earlier post; the previously attached
ServerServlet works fine, other than a couple transient declarations I left
out.  I attached it to RFE #127, which I think it makes a big dent in.  The
good news from my perspective is that this better approach can land in a big
deliverable we have this weekend ...  :-)


A note on why this unfortunately ugly composition approach is necessary:

Tom McGee's solution (posted here:
http://www.mail-archive.com/[email protected]/msg02621.html) only
works if you are mounting Restlet under hosted mode at a particular location
(e.g. /api/v1/* in the example).  If you want Restlet to have full control
of the URI space from /*, a solution like this is needed, since the
GWTShellServlet will only work properly if mounted at /*, and fixing that
limitation is not a high priority for the GWT team.  My use case is wanting
to run/debug an entire application -- GWT client and (fairly complicated)
Restlet-based server -- from an Eclipse project.


A neat (and sometimes necessary) feature:

Restlets can tell whether or not they are running under GWT Hosted Mode by
interrogating the "module" configuration parameter:

    public boolean isHostedMode(){
        return getContext().getParameters().getFirstValue("module")!=null;
    }

P.S. Jerome, I know you will want to rename the "module" parameter something
else, but GWTShellServlet wants it named "module," so renaming it would
require extra care and monitoring that I didn't sign up for  :-)


Next steps in meaningful GWT integration:

Jon R. Crosby's GWT-REST project, http://code.google.com/p/gwt-rest/ is
discussed here as a GWT-Restlet adapter in response to a post by Justin
Stanczak to the GWT Google Group:
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/353f76f8662d778c/1fc5e2a3ddb9cad9?#1fc5e2a3ddb9cad9

GWT-REST provides a class library for the REST vocabulary and, as the
creator states, is general enough to work with Restlet.  It's early and very
heavy on speaking to JSON and Rails, but nice.  From a few posts I read, I
don't think he did it with any reference to prior art in the Restlet high
level API, so the differences may be more accidental than intentional.

I'd like to see some dialogue opened with the GWT-REST project to see if we
couldn't somehow converge its high level REST API with Restlet -- or if not,
provide the Restlet-style high level API in a form that will compile neatly
to GWT's browser-hosted Javascript.  I'd hate to outright compete with what
GWT-REST has done, but I don't want to speak two different but eerily
similar Java REST APIs in different aspects of the same project.

- Rob

Reply via email to