Custom response for root request int the Spring REST HATEOAS with both RepositoryRestResource-s and regular controllers

余生长醉 提交于 2019-11-28 17:03:38
palisade
@Component
public class HelloResourceProcessor implements ResourceProcessor<RepositoryLinksResource> {

    @Override
    public RepositoryLinksResource process(RepositoryLinksResource resource) {
        resource.add(ControllerLinkBuilder.linkTo(HelloController.class).withRel("hello"));
        return resource;
    }
}

based on

Chris DaMour

You need to have a ResourceProcessory for your Person resource registered as a Bean. see https://stackoverflow.com/a/24660635/442773

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!