Blog

New JSR to define a high-level REST API for Java

February 14, 2007

Posted by Jerome Louvel in : Java, JSR 311, Restlet General - no comment

As the Java community is increasingly using REST to develop their Web applications, Sun Microsystems is proposing to specify a high-level REST API for Java. If accepted for development by the JCP Executive Comitee, this JSR#311 will formalize as a set of Java 5 annotations to facilitate the exposition of Java objects as REST resources.

These annotations will provide a high-level REST API that will be supported by lower-level APIs.

The JSR expert group will be led by Marc Hadley and Paul Sandoz from Sun. Marc is the author of WADL (Web Application Description Language), a RESTful alternative to WSDL. As the lead of the Restlet project, I was invited to be part of the initial expert group for this JSR. I am looking forward to work with other experts and with anyone interested to see a better support for REST in Java.

There is one related effort named JRA (Java REST Annotations) that I am aware of. That will be one source of inspiration. Personnally, I’m hoping it will promote a deeper mapping to REST, covering the following requirements:

  • Doesn”t impose any constraint on resource URIs structure.
  • Support dynamic URIs based on the URI Template draft.
  • Support all HTTP methods as well as extensions like in WebDAV.
  • Support all media types and not just XML.
  • Support multiple representations of the same resource.
  • Fully embrace the resource-oriented design paradigm.

[Update 1] Another related effort I would like to mention is Sommer, led by Henry Story, which provides a mapping (via annotations) between Java objects and RDF graphs. RDF means Resource Description Framework and is the core specification of the Semantic Web. It formally describes resources (in the REST sense), their URIs and their relationships.

[Update 2] A related thread was started in the REST discussion list.

[Update 3] More links about the announce:

[Update 4] Interesting insights from Andrew S. Townley (anterior to JSR announcement)

[Update 5] The JAX-RS extension for Restlet has been added to release 1.1 M3. See the announcement and the documentation about the extension.