O'Reilly logo

RESTful Java Patterns and Best Practices by Bhakti Mehta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Entity providers and different representations

In the previous examples, we passed literal parameters picked from a URI path fragment as well as from the request's query parameters to the resource method. However, there are cases when we want to pass a payload in the request body, for example a POST request. JAX-RS provides two interfaces that can be used: one for handling the inbound entity representation-to-Java de-serialization known as javax.ws.rs.ext.MessageBodyReader, and the other one for handling the outbound entity Java-to-representation serialization known as javax.ws.rs.ext.MessageBodyWriter.

MessageBodyReader de-serializes entities from the message body representation into Java classes. MessageBodyWriter serializes a Java class to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required