Advertisment

Building RESTful Web services in Java

author-image
CIOL Bureau
Updated On
New Update

BANGALORE, INDIA: Arun Gupta, a Java EE & GlassFish Evangelist working at Oracle, talked about REST (Representational State Transfer) and covered various topics like its principles, the new JAX-RS 2.0, GET features and many more, at the opening day of the two-day Spark IT 2011 conference here on Thursday.

Advertisment

He shared about the principles of REST that the developers should give everything an ID, identify and follow standard set of methods, link the resources together, multiple representations and stateless communication.

He said, “ID is Uniform Resource Identifier (URI); each resources are identified by URI. ID provided by @annotation value is relative in URI.”

He suggested that after identifying the resource, four standard methods are followed namely GET, POST, PVT, and DELETE.

Gupta said that JAX-RS was two years old, open source, and he added that the new version routes request to approve reasons, class, adopts flexible method signature, annotation on parameter, specify mapping from request, return value of mapped to response. The JAX-RS API uses annotations to simplify the development of RESTful web services.

Another feature on REST is the multiple representations where they offer data in a variety of formats (XML, JSON, xHTML), with maximized reach. It also supports content negotiation and use static-annotate methods or class with static.

tech-news