Jersey 2 InjectLink is ignored Jersey 2 InjectLink is ignored json json

Jersey 2 InjectLink is ignored


I have added the following to my servlet config:

`<init-param>        <param-name>jersey.config.server.provider.classnames</param-name>        <param-value>            org.glassfish.jersey.linking.DeclarativeLinkingFeature        </param-value>    </init-param>'

and the links were rendered in the json response.


For information, if you do not want to use web.xml config file, you can do that:

import javax.ws.rs.ApplicationPath;import org.glassfish.jersey.linking.DeclarativeLinkingFeature;import org.glassfish.jersey.server.ResourceConfig;@ApplicationPath("rest/v1")public class MyApp extends ResourceConfig {    public MyApp () {        packages("the.package.where.your.services.are.located")            .register(DeclarativeLinkingFeature.class);    }}