Packaging and deploying JAX-RS applications

There are multiple ways to configure, package, and deploy a JAX-RS application. While configuring an application, you can use an annotation-based approach (for the Servlet 3.x based container) and thereby avoid deployment descriptors such as web.xml. Alternatively, you can use a mix of both approaches, which uses both annotations and web.xml. This section describes the various configurations and packaging models followed for a JAX-RS web service application.

The JAX-RS specification states that a RESTful web service must be packaged as part of a web application if you want to run it in a container (web server or application server). Following this rule, any JAX-RS application that you want to deploy on ...

Get RESTful Java Web Services - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.