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); //Package that needs to be scanned for other resource packages("com.packtpub.rest.ch5.service"); } }