Hiram Chirino

Hiram Chirino

Bit Mojo - My random ramblings on hawt technology.

Hiram Chirino

2 minute read

If your familiar with GWT RPC, then you you know that it’s it’s provides a very nice client side framework for doing AJAX requests against Java Servlets.  The sad part is that it uses a binary protocol.  That protocol is not easily understood by other languages or frameworks.

Counter that with latest AJAX rage, RESTful services with a JSON or XML representation of the data.  The nice thing about using JSON with REST services is that clients and servers can easily be built it any language.  Wouldn’t it be nice if you use JSON RESTful services from GWT with the ease of GWT RPC?

That’s exactly the reason I started hacking on RestyGWT.  It uses a very similar development model as GWT RPC.  You create a service interface who’s implementation is code generated via Deferred Binding when your GWT module is built.  The developer maps the interface methods to RESTful HTTP requests using the excelent JAX-RS annotations.  Just like in GWT RPC, the interface must be ‘asynchronous’.  You must use callback method arguments to get the request results.  But unlike GWT RPC, the data sent and received will be JSON encoded.  RestyGWT will automatically code generate JSON encoders and decoders for any classes sent or received from the rest service.

For more details see the Git Hub home page at: http://github.com/chirino/resty-gwt

As of this point, RestyGWT only implements the most basic JAX-RS annotations and provides a very simple JSON encoding scheme.  Despite that, the project is already extremely useful.  I would love here what folks think about it.

comments powered by Disqus

About

I'm a software engineer for Red Hat Inc.
Disclaimer: The views expressed on this site are mine alone and do not necessarily reflect the views of my employer or its affiliated entities.

Recent posts

See more

Categories