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

Modifying JAX-RS resources during deployment using ModelProcessor


Sometimes, you may want to modify the existing JAX-RS resources during deployment to meet the specific business conditions set by customers. For instance, consider a scenario where you want to add additional APIs to return the JSON schema, which describes the content structure for all the REST resources that your application exposes. Further, there may be scenarios where you may want to change the entire resource method implementation itself to meet the requirements of some of the customers. In this section, we will learn how to address such use case requirements with the Jersey framework.

The Jersey framework allows you to modify or enhance JAX-RS resources during deployment by registering your own JAX-RS resource model processor providers. Let us take a closer look at this feature.

What is Jersey ModelProcessor and how does it work?

When you deploy a JAX-RS application into a Jersey-based container, the Jersey runtime generates...