Class LocalHostUriTemplateHandler

  • All Implemented Interfaces:
    org.springframework.web.util.UriTemplateHandler

    public class LocalHostUriTemplateHandler
    extends org.springframework.boot.web.client.RootUriTemplateHandler
    UriTemplateHandler will automatically prefix relative URIs with localhost:${local.server.port}.
    Since:
    1.4.0
    • Constructor Detail

      • LocalHostUriTemplateHandler

        public LocalHostUriTemplateHandler​(org.springframework.core.env.Environment environment)
        Create a new LocalHostUriTemplateHandler that will generate http URIs using the given environment to determine the context path and port.
        Parameters:
        environment - the environment used to determine the port
      • LocalHostUriTemplateHandler

        public LocalHostUriTemplateHandler​(org.springframework.core.env.Environment environment,
                                           String scheme)
        Create a new LocalHostUriTemplateHandler that will generate URIs with the given scheme and use the given environment to determine the context-path and port.
        Parameters:
        environment - the environment used to determine the port
        scheme - the scheme of the root uri
        Since:
        1.4.1
    • Method Detail

      • getRootUri

        public String getRootUri()
        Overrides:
        getRootUri in class org.springframework.boot.web.client.RootUriTemplateHandler