Book Image

Developing RESTful Services with JAX-RS 2.0, WebSockets, and JSON

By : Bhakti Mehta, Masoud Kalali
Book Image

Developing RESTful Services with JAX-RS 2.0, WebSockets, and JSON

By: Bhakti Mehta, Masoud Kalali

Overview of this book

<p>As the technology landscape moves focus towards smaller devices, the need for building scalable, flexible, lightweight, and real-time communications-based applications grows. HTML 5 and Java EE 7 provide a new synthesis of technologies that demonstrate tremendous scope and potential in areas of device independence, asynchronous communication, interoperability, and portability.<br /><br />Developing RESTful Services with JAX-RS 2.0, WebSockets, and JSON is a practical, hands-on guide that provides you with clear and pragmatic information to take advantage of the real power behind HTML5 and Java EE technologies. This book also gives you a good foundation for using them in your applications.<br /><br />Developing RESTful Services with JAX-RS 2.0, WebSockets, and JSON looks at the different HTML5-based Java EE 7 API, and takes a deep dive into the individual areas of technologies to cover basic to advanced concepts, and also provides best practices for each API. You will also learn how to build a REST-based Event Notification Application using the Twitter API, tying all the different technologies together that we will cover. You will also take a look at integrating different Java EE APIs to build a Library Application. If you want to take advantage of using the new HTML5 technologies and Java EE 7 platform, then this is the book for you. You will learn everything you need to know to build portable RESTful Web Services with JAX-RS 2.0, Web Sockets, JSON, and Server-Sent Events.</p>
Table of Contents (12 chapters)

Java EE and the emerging standards


Java EE has always been an adopter of emerging standards and features and capabilities, which were required by the Java EE community. Starting from Java EE 6, Java EE spec leads focused their attention on the emerging standards and in Java EE 7 full support for HTML5, SSE and WebSockets is included in the spec; thus any Java EE application server can host a WebSockets, SSE, and HTML5-oriented application without any compatibility issue at the server side.

Java EE and Server-sent Events

For the SSE, which is an HTML5 browser API component, the server side can be a Servlet that produces SSE messages according to the SSE message format or it can be a SSE resource which is POJO annotated with @Path. In the client side, JavaScript can be used as the standard in-browser API to consume the SSE events or it can be developed using the SSE client side API introduced in Jersey 2.0 if a Java-based client is required.

The following table shows the important classes and...