title: What's the replacement for deprecated DefaultUriTemplateHandler for RestTemplate?
body: <p>Pre-Spring 5, the usual way to configure the RestTemplate for accessing single REST host was as follows:</p>
  
  <pre><code>DefaultUriTemplateHandler uriTemplateHandler = new DefaultUriTemplateHandler();
  uriTemplateHandler.setBaseUrl("http://host:port");
  restTemplate.setUriTemplateHandler(uriTemplateHandler);
  </code></pre>
  
  <p>so that when making REST calls, one can do <code>restTemplate.getForObject("/api/foo")</code> instead of <code>restTemplate.getForObject("http://host:port/api/foo")</code> (and possibly configure the REST root URL somewhere centralized)</p>
  
  <p>In Spring 5, <code>DefaultUriTemplateHandler</code> is deprecated, and the suggested replacement is <code>DefaultUriBuilderFactory</code>. However, while the <code>RestTemplate</code> still has the <code>setUriTemplateHandler</code> method, it has no setter accepting an <code>UriBuilderFactory</code>, nor an <code>UriBuilderFactory</code> has anything resembling <code>setBaseUrl</code></p>
  
  <p>What is the proper replacement for this configuration pattern in Spring 5?</p>