+

Search Tips   |   Advanced Search

Configure JAX-RS applications using JAX-RS 1.1 methods

With Java EE 6 functionality we can use the annotation scanning capabilities. By using annotation scanning, we can omit a JAX-RS javax.ws.rs.core.Application subclass or have a minimally defined javax.ws.rs.core.Application subclass.

The JAX-RS 1.1 specification supports several new ways to configure a JAX-RS application. Use the built-in annotation scanning to help automatically configure the application. We can optionally add javax.ws.rs.core.Application subclasses to the 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, we 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.

Use a Java Servlet 3.0 web.xml file. This allows us to specify security constraints.


Results

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


Related tasks

Configure web.xml for JAX-RS servlets
  • Configure web.xml for JAX-RS filters