Book Image

RESTful Java Web Services, Second Edition

Book Image

RESTful Java Web Services, Second Edition

Overview of this book

Table of Contents (17 chapters)
RESTful Java Web Services Second Edition
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Programmatically configuring JAX-RS resources during deployment


The JAX-RS supports multiple ways to configure a RESTful web service application. A common approach is to subclass javax.ws.rs.core.Application and configure RESTful resources by overriding the appropriate methods. To learn more about configuring JAX-RS applications, refer to the Packaging and deploying JAX-RS applications section in Appendix, Useful Features and Techniques, of this book.

The Jersey framework provides more advanced configuration options for JAX-RS applications through the org.glassfish.jersey.server.ResourceConfig class. The ResourceConfig class is subclassed from javax.ws.rs.core.Application. We have used the Application class in the previous chapter for configuring a vanilla JAX-RS application. The ResourceConfig class offers many extra configuration features on top of the standard JAX-RS Application class. With the ResourceConfig class, you can define the JAX-RS resources via an array of class names; you can...