Skip to the content.

JAX-RS and REST

To know in detail about the theory of JAX-RS and how to design REST services there is an excellant tutorial available: javabrains-jax-rs

The examples in my tutorials use JAX-RS on Websphere (Apache Wink 2.0) but the general jax api and concepts remain the same.

REST: Introduction

Representational state transfer (REST) is a software architectural style consisting of a coordinated set of architectural constraints applied to components, connectors, and data elements, within a distributed hypermedia system. It is a way to create, read, update or delete information on a server using simple HTTP calls.

Web service APIs that adhere to the REST constraints are called RESTful. RESTful APIs are defined with these aspects:

RESTful webservice in the world of java is JAX-RS. JAX-RS is a specification.

There are a number of implementations available.

JAX-RS works as a client-server model. It is stateless as it’s based on HTTP. And cacheable too. REST follows HATEOAS principle. HATEOAS stands for Hypertext As The Engine Of Application State. It means that hypertext should be used to find your way through the API. - See more at: RestCookBook

Difference between Servlets and REST? REST is really an architectural pattern used when designing an API on a server. HttpServlets can be a method of implementing a RESTful web service in java. REST describes a style where HTTP verbs like GET/POST/DELETE/etc. are used in a predictable way to interact with resources on a server.

Websphere application server implementation

The IBM implementation of JAX-RS is an extension of the base Apache Wink 1.1 runtime environment. IBM JAX-RS includes the following features:

Note that there is no JAX-RS defined client API. Each implementation rolls out their own client API.

Tutorial series