Lesson 33: Working with RESTful Web Services

Yakov Fain · 2015

The Java EE specification includes the JAX-RS API for creating the server- and client-side programs for RESTful Web Services. All Java EE-compliant application servers implement JAX-RS. This chapter explains how to implement RESTful Web Services by redesigning a familiar stock server example. The representation of the resources can vary and is determined by media type. Development of a RESTful application with JAX-RS is pretty straightforward: create a small Java class that extends javax.ws.rs.core.Application, which registers your application with a Java EE server; create and properly annotate a REST endpoint, which is a POJO; define a Java bean that will be converted into XML, JSON, or some other format for communicating with the client's application; and create any number of helper classes that implement application logic. The chapter shows a reader how this can be done. It also defines Contexts and Dependency Injection (CDI).

Read the paper · More papers on PaperTik