August 2013
Intermediate to advanced
360 pages
10h 47m
English
In the first edition, the JAX-WS APIs and their Metro implementation were dominant. In this edition, the two are important but less dominant. For REST-style services, the book has examples based on the following APIs:
HttpServlet
HttpServlet is well designed for REST-style services
because the API is so close to the HTTP metal. Servlet instances encapsulate callbacks such as doPost, doGet, doPut,
and doDelete, which cover the familiar CRUD operations: create (POST), read (GET), update (PUT), and delete
(DELETE). There are symbolic versions of HTTP status codes to signal the outcome of an HTTP request, support for
MIME types, utilities to access HTTP headers and bodies, and so on. JSP and other Java-based scripts execute as
servlet instances and, therefore, fall under the servlet umbrella.
The HttpServlet is grizzled but
hardly obsolete. Servlets are still an excellent way to deliver REST-style services.
@GET and @POST to route HTTP requests to particular Java methods. There is likewise a
convenient @Path annotation to identify the particular resource targeted in a request. JAX-RS can be configured to automatically generate XML and JSON responses. This API, like the Restlet API described next, has a contemporary look and feel. At the implementation level, JAX-RS represents a layering atop servlets. ...Read now
Unlock full access