November 2017
Intermediate to advanced
420 pages
10h 29m
English
Once you have the appropriate dependency set up, the next step is to enable the declarative linking feature by registering the org.glassfish.jersey.linking.DeclarativeLinkingFeature class with the application. You can do this via the org.glassfish.jersey.server.ResourceConfig class, as shown in the following code snippet:
//Other imports are omitted for brevity import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.linking.DeclarativeLinkingFeature; @Provider @javax.ws.rs.ApplicationPath("webresources") public class ApplicationConfig extends ResourceConfig { public ApplicationConfig() { // Register a class of JAX-RS component register(DeclarativeLinkingFeature.class); ...