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 Summary

      Constructors 
      ConstructorDescription
      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.
      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.
      LocalHostUriTemplateHandler​(org.springframework.core.env.Environment environment, String scheme, org.springframework.web.util.UriTemplateHandler handler)
      Create a new LocalHostUriTemplateHandler that will generate URIs with the given scheme, use the given environment to determine the context-path and port and delegate to the given template handler.
    • 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
      • LocalHostUriTemplateHandler

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

      • getRootUri

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