Configuring JAX-RS applications using JAX-RS 1.1 methods

You can configure Java™ API for RESTful Web Services (JAX-RS) applications in multiple ways depending on your needs. To take advantage of the Java Platform, Enterprise Edition (Java EE) 6 functionality, you can use the annotation scanning capabilities. By using annotation scanning, you can omit a JAX-RS javax.ws.rs.core.Application subclass or have a minimally defined javax.ws.rs.core.Application subclass.

About this task

The JAX-RS 1.1 specification supports several new ways to configure a JAX-RS application.  You can use the built-in annotation scanning to help automatically configure the application. You can optionally add javax.ws.rs.core.Application subclasses to your application and then add the URL patterns required using either the javax.ws.rs.ApplicationPath annotation or a web.xml servlet definition. When using the IBM® JAX-RS implementation, you do not have to specify the servlet class implementation because it is automatically added to the configuration of the web module by the time the JAX-RS application is started.

When using a web.xml file, you must use a Java Servlet 3.0 web.xml file.

Procedure

Results

You have configured your JAX-RS application using JAX-RS 1.1 supported methods by taking advantage of annotation scanning to help automatically configure the application.

Icon that indicates the type of topic Task topic



Timestamp icon Last updated: March 5, 2017 17:29
File name: twbs_jaxrs_configjaxrs11method.html