Developing RESTful Web Services with Jersey 2.0 by Sunil Gulabani

By Sunil Gulabani

JAX-RS 2.0 is an improved framework according to RESTful structure. It presents aid for either the buyer and the server. Jersey 2.0 is the reference implementation of JAX-RS 2.0 (JSR 339 specification). This framework has passed through significant revisions. the improved framework is helping builders to exploit a low-level and simplified API.
This functional, hands-on advisor might help you to create RESTful internet providers simply with person points of the appliance requests. it's going to show you how to study and enforce RESTful net companies utilizing the recent gains incorporated in JAX-RS 2.0. It’s a bounce commence should you are looking to try out their hand on the new API. It goals to supply useful wisdom of the API in addition to distinct knowing.

Show description

Read or Download Developing RESTful Web Services with Jersey 2.0 PDF

Similar client-server systems books

Content Distribution Networks: An Engineering Approach

Content material distribution networks (CDNs) are the main promising new ideas for dealing with the massive and quickly starting to be quantity of net site visitors. In essence, CDNs are teams of proxy-servers situated at strategic issues round the web and organized on the way to make sure that a obtain request can continually be dealt with from the closest server.

MCSE: Windows Server 2003 Active Directory Planning, Implementation, and Maintenance Study Guide (70-294)

This is the ebook you want to arrange for examination 70-294, making plans, imposing, and holding a Microsoft home windows Server 2003 energetic listing Infrastructure. This learn consultant presents: In-depth insurance of each examination aim useful details on making plans, enforcing, and conserving a home windows Server 2003 energetic listing infrastructure 1000s of not easy perform questions modern examination coaching software program, together with a try out engine, digital flashcards, and simulation software program Authoritative assurance of all examination targets, together with: making plans and enforcing an energetic listing infrastructure coping with and keeping an energetic listing infrastructure making plans and enforcing consumer, desktop, and workforce innovations making plans and imposing workforce coverage notice: CD-ROM/DVD and different supplementary fabrics aren't integrated as a part of e-book dossier.

Hands-On Microsoft Windows Server 2008

Hands-On Microsoft home windows Server 2008 is the right source for studying home windows Server 2008 from the ground-up! Designed to construct a starting place in easy server management, the booklet calls for no earlier server event. It covers all the serious home windows Server 2008 gains, together with the positive aspects specific to this new server working procedure, from home windows Server 2008 positive factors and models to fitting, configuring, and utilizing Hyper-V digital server functions.

Introducing Microsoft System Center 2012 R2

Get a head begin comparing approach heart 2012 R2 - with technical insights from a Microsoft MVP and individuals of the process heart product crew. This consultant introduces new good points and services, with scenario-based recommendation on how the platform can meet the desires of your corporation. Get the high-level assessment you must commence getting ready your deployment now.

Additional info for Developing RESTful Web Services with Jersey 2.0

Sample text

Thus, it becomes easier to invoke where multiple client requests with different MIME types. [ 19 ] Server API @Consumes The @Consumes annotation is used to specify the MIME types that a method (or web service) can consume. @Consumes is defined at the following two levels: • Class-level: All the methods in a resource can produce the specified MIME types by default. • Method-level: It overrides the specified MIME types at the class level. If a resource is unable to consume the MIME type of a client request, the JAX-RS runtime sends back an HTTP 415 (Unsupported Media Type) error.

Subresource locator method: @Path("/userService") public class UserResource { @Path("/getAddress") public AddressResource getAddress(@QueryParam("id") int id) { ... } } • Bean setter method: @Path("/userService") public class UserResource { @GET @Path("{id}") public String getUser() { ... } @PathParam("id") public void setId( int id){ ... } } [ 31 ] Server API Deploying a RESTful web service There are several ways to deploy the JAX-RS applications. Some of them are illustrated as follows: • Using the abstract Application class: In this type, we provide all the root-resource classes to the Application class.

29 ] Server API Rules of injection Injection can be applied on fields, constructor parameters, resources, subresources, subresource locators, method parameters, and setter methods. It helps to identify which path or parameter of the request needs to be handled. Let's look at the following examples: • Root-resource: @Path("/userService") public class UserResource { ... } • Fields: @Path("/userService") public class UserResource { ... @QueryParam("name") private String name; ... } • Constructor parameter: @Path("/userService") public class UserResource { public UserResource(@PathParam("id") int id){ ...

Download PDF sample

Rated 4.54 of 5 – based on 36 votes