WAS v8.5 > Reference > Developer detailed usage information

Liberty profile: JAX-RS

This topic provides an overview of Java™ API for RESTful Web Services (JAX-RS) in the Liberty profile.

Implementing JAX-RS web applications

We can use JAX-RS to develop services that follow Representational State Transfer (REST) principles. Using JAX-RS, development of RESTful services is simplified.

For more information, see the WebSphere Application Server full profile topic Implementing JAX-RS web applications.

The following sections, and any subtopics are not relevant to the Liberty profile:

  • Configure the development environment

Additionally:

Using XML content in JAX-RS application requests and responses

XML is a common media format that RESTful services consume and produce. To deserialize and serialize XML, we can represent requests and responses by Java Architecture for XML Binding (JAXB) annotated objects.

For more information, see the WAS full profile topic Using XML content in JAX-RS application requests and responses.

The following sections, and any subtopics are not relevant to the Liberty profile:

  • Configure the development environment

Using Atom content in JAX-RS application requests and responses

We can use the Atom Syndication Format (Atom) to format web feeds, which communicate news and updates of episodic information about websites. Using Atom content in JAX-RS applications, we can take advantage of web content syndication that provides the same decentralized, dynamic mechanisms for adding new metadata and content supported by RSS, but does so in a way that helps protect core interoperability between implementations.

For more information, see the WAS full profile topic Using Atom content in JAX-RS application requests and responses.

The following sections, and any subtopics are not relevant to the Liberty profile:

  • Configure the development environment

Using custom entity formats

Even though the JAX-RS runtime environment includes several entity providers for handling serialization from and deserialization to Java types, it does not support all possible media types. We can develop a custom entity provider to handle binding Java types to message bodies.

For more information, see the WAS full profile topic Using custom entity formats.

The following sections, and any subtopics are not relevant to the Liberty profile:

  • Configure the development environment

Using content negotiation to serve multiple content types in JAX-RS applications

One of the advantages of RESTful applications is the ability to return different representations of resources. With Representational State Transfer (REST), clients and servers can exchange resources of the same media type or use differing media types. Content negotiation enables clients and servers to agree on the content format used to exchange data.

For more information, see the WAS full profile topic Using content negotiation to serve multiple content types in JAX-RS applications .

The following sections, and any subtopics are not relevant to the Liberty profile:

  • Configure the development environment

Using JAX-RS context objects to obtain more information about requests

JAX-RS provides different types of context to resource classes and providers. We can use context objects to access request information such as discovering the HTTP headers sent as part of the request. Context objects also provide convenience methods for evaluating a request and building an appropriate response.

For more information, see the WAS full profile topic Using JAX-RS context objects to obtain more information about requests.

The following sections, and any subtopics are not relevant to the Liberty profile:

  • Configure the development environment

Using handlers to enhance request and response processing

We can implement handlers on the server-side of a JAX-RS application to enhance request and response processing.

For more information, see the WAS full profile topic Using handlers to enhance request and response processing

The following sections, and any subtopics are not relevant to the Liberty profile:

  • Configure the development environment

Using multipart content in JAX-RS application requests and responses

Using multipart messages, servers and clients can transmit multiple messages using a single message. Multipart messages are useful when both the client and server need to send multiple requests but want to save the cost of sending and receiving entire HTTP request and responses for each part.

For more information, see the WAS full profile topic Using multipart content in JAX-RS application requests and responses.

The following sections, and any subtopics are not relevant to the Liberty profile:

  • Configure the development environment

Using multipart/form-data content in JAX-RS application requests and responses

A frequently used content type for submitting files through an HTML form is multipart/form-data. The JAX-RS implementation from IBM greatly simplifies the processing of such data by automatically splitting the parts and automatically decoding them. If such automatic processing is not wanted, the resource can instead receive the parts in an object so processing of the parts is under the complete control of the resource method.

For more information, see the WAS full profile topic Using multipart/form-data content in JAX-RS application requests and responses.

The following sections, and any subtopics are not relevant to the Liberty profile:

  • Configure the development environment

Implementing secure JAX-RS applications

The JAX-RS runtime environment from IBM is driven by a servlet derived from the Apache Wink project. Within the WAS environment, the lifecycle of servlets is managed in the web container. Therefore, the security services offered by the web container are applicable to REST resources deployed in WAS.

For more information, see the WAS full profile topic Implementing secure JAX-RS applications.

The following sections, and any subtopics are not relevant to the Liberty profile:

  • Configure the development environment
  • Secure JAX-RS resources using annotations
  • (optional) Secure JAX-RS clients using SSL
  • Administer the secure JAX-RS application

Additionally:

  • In Secure JAX-RS applications within the web container, the reference to the directory structure for the AddressBookApp deployment descriptor is not relevant to the Liberty profile. After you install the AddressBookApp application in the Liberty profile, the WEB-INF\web.xml file of the web application looks like the example provided in the link.
  • In the Liberty profile, the default context root is the name of the WAR file. For more information about options when configuring context roots, see Deploying a web application to the Liberty profile.

Using WADL to generate service documentation

Web Application Description Language (WADL) is a description language for HTTP-based applications. It is currently a World Wide Web Consortium (W3C) Member Submission. WADL can be used by programs to give information about the service in a machine-processable method. For instance, you can use an XSLT document to transform the WADL documentation using a custom XSLT and an XSLT processor.

For more information, see the WAS full profile topic Using WADL to generate service documentation.

The following sections, and any subtopics are not relevant to the Liberty profile:

  • Configure the development environment

Using the Apache Wink REST client inside server applications to issue requests

We can use the Apache Wink REST client as a client that can be run to send requests to your JAX-RS application.

For more information, see the WAS full profile topic Using the Apache Wink REST client inside server applications to issue requests.

Any reference to thin client, unmanaged client, or dmgr console are not relevant to the Liberty profile.

If we use the jaxrs-1.1 feature, specify the servlet-3.0 or jsp-2.2 features separately.


Parent topic: Deploying JAX-RS applications to the Liberty profile


Reference topic |