Skip to Main Content
Java EE 6 Pocket Guide
book

Java EE 6 Pocket Guide

by Arun Gupta
September 2012
Intermediate to advanced content levelIntermediate to advanced
210 pages
3h 59m
English
O'Reilly Media, Inc.
Content preview from Java EE 6 Pocket Guide

Chapter 9. RESTful Web Services

RESTful web services are defined as JSR 311, and the complete specification can be downloaded from http://jcp.org/aboutJava/communityprocess/mrel/jsr311/index.html.

REST is an architectural style of services that utilizes web standards. Web services designed using REST are called RESTful web services. The main principles of RESTful web services are:

  • Everything can be identified as a resource and each resource is uniquely identifiable using a URI.

  • A resource can be represented in multiple formats, defined by a media type. The media type will provide enough information on how the requested format needs to be generated. Standard methods are defined for the client and server to negotiate on the content type of the resource.

  • Use standard HTTP methods to interact with the resource: GET to retrieve a resource, POST to create a resource, PUT to update a resource, and DELETE to remove a resource.

  • Communication between the client and the endpoint is stateless. All the associated state required by the server is passed by the client in each invocation.

Java API for RESTful web services (JAX-RS) defines a standard annotation-driven API that helps developers build a RESTful web service in Java. The standard principles of REST, such as identifying a resource as a URI, a well-defined set of methods to access the resource, and multiple representation formats of a resource, can be easily marked in a POJO using annotations.

Simple RESTful Web Services

A simple RESTful web service ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java EE 7 Essentials

Java EE 7 Essentials

Arun Gupta
Beginning Java EE 7

Beginning Java EE 7

Antonio Goncalves
The Java EE 6 Tutorial: Advanced Topics, Fourth Edition

The Java EE 6 Tutorial: Advanced Topics, Fourth Edition

Eric Jendrock, Ricardo Cervera-Navarro, Ian Evans, Devika Gollapudi, Kim Haase, William Markito, Chinmayee Srivathsa

Publisher Resources

ISBN: 9781449338329Errata