Jersey framework extensions

Let's start our discussions on Jersey with a baby step. If you want to use any Jersey-specific feature in an application, then you will have to add a dependency to the appropriate Jersey libraries. For instance, to use a Jersey configuration class such as org.glassfish.jersey.server.ResourceConfig in your application, you need to depend on the jersey-container-servlet JAR. If the consuming application uses Maven for building the source, then specifying a dependency to the jersey-container-servlet JAR in the Project Object Model (POM) file may look like the following:

<dependency> 
    <groupId>org.glassfish.jersey.containers</groupId> 
   
  <!-- module --> 
    <artifactId>jersey-container-servlet</artifactId> 
 
  <!-2.26: latest release version --> 
    <version>2.26</version> 
     
    <!-- container(GlassFish) provides dependency 
         for this example --> 
    <scope>provided</scope> 
</dependency> 
An application that uses Jersey and depends on Jersey modules is, in turn, required to also include in the application dependencies the set of third-party modules that the Jersey modules depend on. Jersey is designed as a pluggable component architecture, and different applications can therefore require different sets of Jersey modules. This also means that the set of external Jersey dependencies required to be included in the application dependencies may vary in each application, based on the Jersey modules that are being used by the application. A list of the core Jersey modules and their dependencies is available at https://jersey.github.io/documentation/latest/modules-and-dependencies.html.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.205.235