- April 01, 2009

This post isn’t an April Fools’ Day joke! We did released Restlet 1.2 M2 today including major enhancements:

Resource API refactoring

After a long experience with our class-driven Resource API introduced in Restlet 1.0 and the recent introduction of the annotation-driven JAX-RS API (that we support as a special Restlet extension), we felt it was time for us to step-back and propose a better solution, taking the best of both experiences.

We initiated a specification effort in our developers wiki at the beginning of this year, taking into account all the enhancement requests, issues and feed-back made by our community (with a special mention to Tim Peierls). Then, we analyzed those requirements and developped a first implementation for Restlet 1.2 M2. Here is the overall architecture:


The new design uses three foundation classes (UniformResource, ClientResource and ServerResource) which support just four annotations by default: @Get, @Post, @Put and @Delete. New ones can be defined to support extension methods like @Copy and @Move for WebDAV. Note that the support for annotations can be turned off and is not necessary to develop resources.

This new design provides the best of both worlds, the power and flexibility of Restlet 1.1 and the expressivity and additional abstraction offered by JAX-RS. In addition, it goes beyond those existing APIs by offering a uniform support for both server and client resources !

We look forward to your feed-back in order to complete and fully stabilize this work. We have started the adaptation of our traditional first steps, first resource and tutorial documents. It should give you a feeling of how it will simplify your Restlet developments.

RDF extension added

After a specification and design effort initiated for Restlet 1.2 M1, we now have a first usable version of our RDF extension. This extension contains a full RDF API, leveraging the Restlet API, and capable of processing RDF documents either in a DOM-like way or in a SAX-like way.


It is also capable of writing large RDF documents is a SAX-like way. We currently support two serialization formats: RDF/XML and RDF/n3. In the next version we will extend those formats to Turtle and NTriples. We will write later about the potential of the REST and RDF combination !

Security API refactoring

Thanks to a strong collaboration with our community, the new security API introduced in 1.2 M1 has been significantly improved and refactored. We have added support for Roles, Realms and Permissions with a better separation of concern between Components and Applications.

The API was deeply refined and now offers a good foundation for your new security efforts. We will focus on its stabilization and testing in the coming months. If you hadn’t have a chance to look at this effort yet, it is still time to influence its design while before we release the first 1.2 RC version which will freeze the API.

New Script extension

A very complete and powerful Script extension has been contributed by Tal Liron. It allows you to write Restlet resources and dynamic representations in the following script languages: Groovy, Jython, JRuby and PHP thanks to the standard “javax.script” facility and to Three Crickets’s Scripturian library.


This extension has been specified in detailled and has a very complete user documentation as well. Some additional work is planned to adjust it to the new resource API presented above, but we encourage all interested users to start playing with it and to provide feed-back.

The potential for this Script extension is huge as it will let us offer Restlet distributions dedicated to those scripting languages and broaden the usage of Restlet with developers not familiar with Java. Thanks again Tal for your hard work and for this wonderful contribution !

Enhanced Maven support

A long time ago, we offered a Maven distribution via our own Maven repositories and regularly we try to improve its quality, for example working with Buckminster users to adjust our Maven metadata. However, we use a custom forge based on Ant as our official build system and this has been causing some pains to Maven developers and putting some barriers for potential contributors.

Thanks to ideas and contributions from the community, we are now providing Maven POM files in our SVN repository as an alternative way to build Restlet. Of course, those POM files are the same that are distributed in our Maven repository and are consistently synchronized with our main Ant script to ensure that they don’t diverge in term of dependency versions for example.


For details on building Restlet with Maven, please read this short page on our developers wiki. Note that we have also adjusted our Maven GroupId (only “org.restlet” is used now) are redistributed third-party libraries are now packaged with a “org.restlet.lib.” ArtifactId prefix.

Package restructuring

In order to ensure a cleaner separation between resource and representation artifacts, we have added a new “org.restlet.representation” package and moved all representation classes to it. The “org.restlet.resource” package is now more focused, allowing us to welcome our new resource API and to move in related classes such as Finder and Handler.

We have also added a “org.restlet.routing” package where we moved Filter, Redirector and Router related classes. We plan to refactor the Route class for more extensibility. We encourage you to have a look at the new API as soon as possible to get familiar with it and anticipate the migration of your existing applications when Restlet 1.2 is stable.

When you upgrade, your existing code will look broken as many imports won’t be resolved. However, simply adjusting the package imports (using the dedicated feature of your IDE, like the “Organize Imports” feature in Eclipse) will fix all those issues. Indeed, the classes themselves have either not changed their API at all or have been properly deprecated.

Additional enhancements

But wait there is more! Many other valuable features were added in this release:

  • JAX-RS extension now leverages the new Security API
  • The TunnelService now supports “X-HTTP-Method-Override” header
  • Client connectors for the ZIP and JAR pseudo-protocols were added
  • The JsonRepresentation was improved (indentation, conversion)
  • Microsoft Shared Key [Lite] HTTP authentication scheme supported
  • Eclipse Public License 1.0 is an additional licensing option offered

Direct contributors

  • Bruno Dumon
  • Cliff Binstock
  • David Fogel
  • Fabrice Boileau
  • Gordon Mohr
  • Jean-Yves Cronier
  • Jonathan Hall
  • Kevin Conaway
  • Lars Heuer
  • Leigh Klotz
  • Marcelo Ochoa
  • Nels Nelson
  • Niall Gallagher
  • Paul Davis
  • Raif S. Naffah
  • RĂ©mi Dewitte
  • Rhett Sutphin
  • Scooter Willis
  • Sean Sullivan
  • Tal Liron
  • Tim Peierls

Thanks to all others who helped us in various ways!

Additonal resources

Changes log:

Download links:

Maven repositories: is updated on the 1st and 15th of each month is updated daily with new artifacts (access reserved to subscribers)