javaspringspring-hateoashateoas

Replace ControllerLinkBuilder in latest Spring HateOAS


I have a old project with the following Spring hateoas import dependency:

import org.springframework.hateoas.mvc.ControllerLinkBuilder;

Do you know into the latest version how I can replace this import?


Solution

  • There is a class WebMvcLinkBuilder. It's used like

    linkTo(OrderController.class).slash(order.getOrderId()).withSelfRel();