X
  • WLS
    October 8, 2008

REST Building Momentum

Guest Author

Lately I've been noticing a lot more references to REST implementations in industry publications.  Today I learned via InfoQ that Netflix recently announced their new REST-based API.  I'm not sure what language or framework they used for the implementation, but I think that REST interfaces will continue to increase and be a technology that is relevant to enterprise Java developers.

At BEA, some of the products such as WebLogic Portal 10.2 and already contained REST API's and other products already had increased developer-friendly REST support in the roadmap such as Oracle Service Bus (formly known as AquaLogic Service Bus).  There is no doubt that customer demand is calling for this in enterprise software.

With JSR 311: JAX-RS: The Java API for RESTful Web Services and the Jersey reference implementation java developers have an annotations based framework to productively implement REST-style services.  There are other java frameworks out there besides Jersey, but this one caught my attention because it's based on the JSR and a reference implementation.  In fact, I stumbled across Oracle developer Gerard Davison's blog that details how to get started with Jersey in WebLogic Server.  If you have an interest in REST for Java, be sure to look at these frameworks for a jumpstart.  In my humble opinion SOAP-based web services still have more enterprise Java mind-share, but I would look for that to balance out over time.

Here's the hello world code snippet from the Jersey Wiki:

package com.sun.ws.rest.samples.helloworld.resources;

import javax.ws.rs.GET;

import javax.ws.rs.Produces;

import javax.ws.rs.Path;

// The Java class will be hosted at the URI path "/helloworld"

@Path("/helloworld")

public class HelloWorldResource {

// The Java method will process HTTP GET requests

@GET
// The Java method will produce content identified by the MIME Media
// type "text/plain"

@Produces("text/plain")
public String getClichedMessage() {
// Return some cliched textual content
return "Hello World";

}

}


Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.