Developing RESTful Web Services with Jersey 2.0


Developing RESTful Web Services with Jersey 2.0
eBook: $20.99
Formats: PDF, PacktLib, ePub and Mobi formats
$17.84
save 15%!
Print + free eBook + free PacktLib access to the book: $55.98    Print cover: $34.99
$34.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Support
Sample Chapters
  • Understand and implement the Jersey and JAX-RS APIs with ease
  • Construct top-notch server and client side web services
  • Learn about Server sent events, for showing real-time data

Book Details

Language : English
Paperback : 98 pages [ 235mm x 191mm ]
Release Date : November 2013
ISBN : 1783288299
ISBN 13 : 9781783288298
Author(s) : Sunil Gulabani
Topics and Technologies : All Books, Application Development, Open Source

Table of Contents

Preface
Chapter 1: Getting Started
Chapter 2: Server API
Chapter 3: Client API
Chapter 4: Common Media-Type Representations
Chapter 5: Server-Sent Events (SSE)
Chapter 6: WADL
Index
  • Chapter 1: Getting Started
    • What is JAX-RS 2.0?
      • Features of JAX-RS 2.0
    • Ease of using and reusing JAX-RS artifacts
    • Modules and dependencies
    • Creating a new project
    • Summary
    • Chapter 2: Server API
      • Root-resource classes
      • @Path
        • @Path with a regular expression
      • HTTP methods
        • @GET
        • @PUT
        • @POST
        • @DELETE
        • @Produces
        • @Consumes
      • Parameter annotations
        • @PathParam
        • @QueryParam
        • @DefaultValue
        • @MatrixParam
        • @HeaderParam
        • @CookieParam
        • @FormParam
        • @BeanParam
      • Subresources
      • Scope of the root-resource classes
      • Rules of injection
      • Deploying a RESTful web service
      • Summary
      • Chapter 3: Client API
        • Consuming web services using a client
          • The get method
          • The post method
          • The put method
          • The delete method
          • The path parameter
          • The query parameter
          • The cookie parameter
          • The matrix parameter
          • The bean parameter
          • The @Produces annotation
          • The @Consumes annotation
        • Use of Invocation.Builder
          • Adding support for new representations
          • Client transport connectors
          • Securing a client
        • Summary
          • Chapter 5: Server-Sent Events (SSE)
            • Getting started
            • Implementing Server-Sent Events (SSE)
              • Consuming the SSE events
            • The pull model (using EventInput)
            • The push model (using EventSource)
          • Summary

              Sunil Gulabani

              Sunil Gulabani is a software engineer based in Ahmedabad, Gujarat (India). He completed his graduation in Commerce from S M Patel Institute of Commerce (SMPIC) and Masters in Computer Applications from Ahmedabad Education Society Institute of Computer Studies (AESICS). He has been a top ranker while pursuing his master's degree. He has also presented a paper "Effective Label Matching For Automated Evaluation of Use Case Diagrams" on Technology For Education (T4E)—IIIT. Hyderabad, an IEEE Conference, along with senior lecturers, Vinay Vachharajani and Dr. Jyoti Pareek. He has been working since 2011 as a software engineer, and is Cloud technology savvy. He has experience in developing enterprise solutions using Java (EE), Apache SOLR, RESTful web services, GWT, SmartGWT, Amazon web services (AWS), Redis, Memcache, MongoDB, and so on. He has a keen interest in system architecture and integration, data modeling, relational databases, and mapping with NoSQL for high throughput. Apart from that, he takes interest in writing tech blogs and is actively involved in a knowledge-sharing community named Java User Group Ahmedabad (JUG-Ahmedabad). You can visit him online at http://www.sunilgulabani.com and follow him on Twitter at twitter.com/sunil_gulabani, or reach him directly at sunil_gulabani@yahoo.com.
              Sorry, we don't have any reviews for this title yet.

              Code Downloads

              Download the code and support files for this book.


              Submit Errata

              Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


              Errata

              - 1 submitted: last submission 13 Feb 2014

              Errata Type: Code | Page Number: 11

              import javax.ws.rs.Path;

              import javax.ws.rs.Get;

              import javax.ws.rs.core.MediaType;

              import javax.ws.rs.Produces;

              /**

              * helloWorld Root Resource

              */

              @Path("helloWorld")

              public class HelloWorldResource{

              @GET

              @PRODUCES(MediaType.TEXT_PLAIN)

              public String greet(){

              return "Hello World!!!";

              }

              }

              should be replaced with

              import javax.ws.rs.Path;
              import javax.ws.rs.GET;
              import javax.ws.rs.core.MediaType;
              import javax.ws.rs.Produces;

              @Path("helloWorld")
              public class HelloWorldResource {

              @GET
              @Produces(MediaType.TEXT_PLAIN)
              public String greet(){
              return "Hello World!!!";
              }

              }

              Sample chapters

              You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

              Frequently bought together

              Developing RESTful Web Services with Jersey 2.0 +    Apache Axis2 Web Services, 2nd Edition =
              50% Off
              the second eBook
              Price for both: $30.90

              Buy both these recommended eBooks together and get 50% off the cheapest eBook.

              What you will learn from this book

              • Implement web services using different HTTP methods and *Param Annotations
              • Create resource and sub-resource methods
              • Understand the different rules of injection and the scope of the root resource classes
              • Explore different deployment processes of applications
              • Consume web services along with different HTTP methods and *Param Annotations
              • Get acquainted with different media representations (JSON, XML, and Multipart)
              • Send/push data events from server to client
              • Generate WADL specification

              In Detail

              JAX-RS 2.0 is an enhanced framework based on RESTful architecture. It provides support for both the client and the server. Jersey 2.0 is the reference implementation of JAX-RS 2.0 (JSR 339 specification). This framework has undergone major revisions. The enhanced framework helps developers to use a low-level and simplified API.

              This practical, hands-on guide will help you to create RESTful web services easily with individual aspects of the application requests. It will enable you to learn and implement RESTful web services using the new features included in JAX-RS 2.0. It’s a jump start for those who want to try their hand at the new API. It aims to provide practical knowledge of the API along with detailed understanding.

              This book covers the new features of JAX-RS 2.0. It covers the complete lifecycle of a web service, that is, from server side to client side. The book focuses on the server API and the client API.

              You will learn how to use the server API in order to create web services that will be deployed on the server. This has all different implementations of HTTP methods and media representations. You will also get acquainted with the client API which specifies how to consume the deployed application’s web services. This includes how to handle different HTTP methods and media representations in response to the web services.

              You will also get to know Server Sent Events (SSE), which the server uses to push the data event directly to the client. The book will finally take you through the WADL specification. By the end of the book, you will be well equipped to implement Jersey 2.0 and JAX-RS.

              Approach

              The book will follow a standard tutorial approach and will teach readers how to use the Jersey API for creating RESTful web services.

              Who this book is for

              This book is intended for Java EE developers who are building applications on the REST architecture. This is a quick, hands-on guide for learning JAX-RS 2.0. Developers should have some knowledge about RESTful web services but it’s not essential to know JAX-RS 1.0.

              Code Download and Errata
              Packt Anytime, Anywhere
              Register Books
              Print Upgrades
              eBook Downloads
              Video Support
              Contact Us
              Awards Voting Nominations Previous Winners
              Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
              Resources
              Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software