RSS Feed for This PostCurrent Article

Java: Open Source REST Framework

Developing a RESTful web application in Java is always not as easy compared with PHP. There are a number of REST frameworks for Java that you may want to use to develop REST web application.

Restlet is a lightweight REST framework for Java, which features,

  • Core REST concepts have equivalent Java classes (UniformInterface, Resource, Representation, Connector for example).
  • Suitable for both client-side and server-side web applications. The innovation is that that it uses the same API, reducing the learning curve and the software footprint.
  • Restlet-GWT module available, letting you leverage the Restlet API from within any Web browser, without plugins.
  • Concept of “URIs as UI” supported based on the URI Templates standard. This results in a very flexible yet simple routing with automatic extraction of URI variables into request attributes.
  • Tunneling service lets browsers issue any HTTP method (PUT, DELETE, MOVE, etc.) through a simple HTTP POST. This service is transparent for Restlet applications.

Axis 2.0 also provides RESTful web services support. The Axis2 REST implementation assumes the following properties:

  • REST Web services are Synchronous and Request Response in nature.
  • When REST Web services are accessed via GET, the service and the operations are identified based on the URL. The parameters are assumed as parameters of the Web service. In this case the GET based REST Web services supports only simple types as arguments.
  • POST based web services do not need a SOAP Envelope or a SOAP Body. REST Web Services do not have Headers and the payload is sent directly.

1060 NetKernel is a resource oriented microkernel and RESTful application server created from the convergence and unification of the powerful fundamental concepts found in the World Wide Web and Unix.

JBoss RESTEasy is a JBoss project that provides various frameworks to help you build RESTful Web Services and RESTful Java applications. It strives to be standards based wherever possible, but to also innovate when appropriate.

RESTEasy implements the JAX-RS specification. JAX-RS, JSR-311, is a new JCP specification that provides a Java API for RESTful Web Services over the HTTP protocol. Resteasy is an portable implementation of this specification which can run in any Servlet container. Tighter integration with JBoss Application Server is also available to make the user experience nicer in that environment.

RESTEasy features

  • JAX-RS implementation
  • Portable to any app-server/Tomcat that runs on JDK 5 or higher
  • Embeddedable server implementation for junit testing
  • EJB and Spring integration
  • Client framework to make writing HTTP clients easy (JAX-RS only define server bindings)

Apache CXF has an initial implementation of JAX-RS (JSR-311): Java API for RESTfulWeb Services. JAX-RS provides a more standard way to build RESTful services in Java. 0.8 version of JSR-311 API is currently supported.

For the inception of REST, you may want to read Architectural Styles and the Design of Network-based Software Architectures.

There is also a good article on Putting Java to REST using RESTEasy.

Trackback URL

Sorry, comments for this entry are closed at this time.