Hot Posts

Linkedin Learning

Handle Bean Validation Failure

June 29, 2017 // 0 Comments

How JAX-RS Handles Validation Failure A bean validation failure results is a “400 Bad Request” response from the server. Let’s learn how to respond to the client with a more informative response. Two Ways to Handle Failures Two technique to report data integrity violations to the client are: respond to the client with a list of [ continue reading ... ]

JAX-RS Media Types

June 28, 2017 // 0 Comments

Introduction to @Consumes and @Produces All resource methods can consume and produce content of almost any type. If you make a POST request to a URI, such as api/books, the REST API expects the HTTP body to contain a payload that represents the resource it should create. This resource can be represented using any media type. Although typically, it [ continue reading ... ]

JAX-RS Resource Entities

June 27, 2017 // 0 Comments

How to Create JAX-RS Resource Entities Let’s take a look at the creation of JAX-RS resource entities, why they should be annotated @XmlRootElement and discover how to use JAXB annotations to facilitate the serialization of JSON to entities. A resource entity is just a Plain Old Java Object. These POJOs are the resources that we [ continue reading ... ]

What is JAX-RS 2.0?

June 23, 2017 // 0 Comments

Introduction to Java EE and JAX-RS JAX-RS is the Java API for RESTful web services, normally shortened to just JAX-RS, and it is Java’s implementation of the REST architectural pattern and provides a simple way to create RESTful APIs. It also provides support for Hypermedia, by following the HATEOAS model. JAX-RS API History JAX-RS 1.1 was [ continue reading ... ]