You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

JAX-RS Concepts

Introduction to JAX-RS concepts - TBD

Applications

A JAX-RS application consists of one or more resources and zero or more providers. A JAX-RS application is packaged as a Web application in a .war file. The Application subclass, resource classes, and providers are packaged in WEB-INF/classes file and the required libraries are packaged in WEB-INF/lib. Included libraries can also contain resource classes and providers as desired.
When using a Servlet 3 container, the Application subclass is optional. By default, all root resource classes and providers packaged in the web application must be included in the published JAX-RS application.

Including Subclasses

An Application subclass can be included in a .war file to override the default behavior. If both getClasses and getSingletons return an empty list then the default "willset" of classes must be used. The implementations should support the Servlet 3 framework pluggability mechanism to enable portability between containers and to avail themselves of container-supplied class scanning facilities.

Servlet Containers

When using a non-JAX-RS aware servlet container, the servlet-class or filter-class element of the web.xml descriptor should name the JAX-RS implementation-supplied Servlet or Filter class respectively. The application-supplied subclass of the application is identified, using an init-param with a param-name of the "javax.ws.rs.application".

  • No labels