A simple definition is:
REST is a way of thinking, not a protocol or standard; it's a style of designing loosely coupled Web applications that rely on named resources - in the form of URLs (Uniform Resource Locators), URIs (Uniform Resource Identifiers), and URNs (Uniform Resource Names), for instance - rather than messages.
REST supports CRUD (create, read, update, delete) type of actions through HTTP requests: POST, GET, PUT and DELETE, respectively.
Java REST framework: Restlet
Restlet is a lightweight java framework that implements REST and can be found at www.restlet.org.
Restlet applications are similar to servlet applications because they reside in the container, but they are different because:
- restlets don't have anything to do with HTTP and its stateful artifacts (ie. cookies, session, etc.)
- restlet framework is extremely lightweight.
It's based on few classes: abstract Application, Resource, Router, Variant.
Resource types in the Restlet framework are known as Restlets.
Read more about Restlet: http://www.restlet.org/documentation/1.0/tutorial
An expample of an REST API can be found here: http://developer.yahoo.com/traffic/rest/V1/
The official web site is located here: http://code.google.com/webtoolkit/
The widgets are UI controls that will be used in our "java pages" (has nothing to do with JSP J). They are very similar (panels, layouts, event listeners etc.) with the "Swing cousins", but so different (some widgets UI don't keep reference to the model or children, so further actions like edit or delete are not possible) from them. The whole list of them can be found at the following link: http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.UserInterface.html as well as the developer's guide: http://code.google.com/webtoolkit/documentation/
There are different types (free or not) of other libraries that, based on GWT, have created more widgets, and look and feels. Here we present two of them: GWT-Ext and GWT-Ext-UX.
This is a free library that is built on top of GWT and EXT (don't make confusion with Ext GWT that is built by company ExtJS and is not free). The GWT-Ext has nicer controls and functionality, and it can be found at this link: http://gwt-ext.com/
2. GWT-Ext UX
This is a smaller free library that is an user's extension, similar like the previous one (GWT-Ext). It can be found at link: http://www.gwt-ext.com/demo-ux/
Both extensions have demo web sites, where the whole collection of widgets can be found, including their sources.
The development can be done with various IDs (Eclipse, JIdea, etc), but here we are talking about Eclipse, because everybody knows, that it's free and very powerful.
So we have here the small list of some prerequisites:
- Eclipse IDE ( www.eclipse.org )
- GWT library (http://code.google.com/webtoolkit/ )
- GWT Designer plugin (http://www.instantiations.com/ )
- [optional] GWT-Ext library (http://gwt-ext.com/ )
- [optional] GWT-Ext-UX library (http://www.gwt-ext.com/demo-ux/ )
The GWT Designer plug-in is from the company Instantiations and, unfortunately, it's not free but it seems to be the best; at least you can use the evaluation version.
First project with Eclipse
A project has a specific directory structure and files. A GWT project contains at least one "module". The main file is with extension ".gwt.html", and it's the descriptor of the application. It includes other modules that are inherited, the entry point, new modules we are defining, servlets mapping, different application init properties, etc.
We can create a new project using the Eclipse new project wizard (using extensively the next button).
After we hit the button "Finish" the project is generated and it has the following content (see the below image). It contains 3 main packages: "client", "server" and "public".
Under public we have the other web resources, which can be used with the GWT, like: html pages, css files, images etc.
From now on, we can add more code to the packages: client, server or public, based on what we want to achieve :-) Success :-)