Remove the few remaining usages of UriTemplate
Also update Javadoc of UriTemplate to point to UriComponentsBuilder and UriBuilderFactory as more flexible options. See gh-24094
This commit is contained in:
@@ -22,7 +22,8 @@ import java.util.Map;
|
||||
import org.springframework.context.support.GenericApplicationContext;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
import org.springframework.web.util.UriTemplate;
|
||||
import org.springframework.web.util.UriComponents;
|
||||
import org.springframework.web.util.UriComponentsBuilder;
|
||||
|
||||
/**
|
||||
* Dummy request context used for FreeMarker macro tests.
|
||||
@@ -107,8 +108,8 @@ public class DummyMacroRequestContext {
|
||||
* @see org.springframework.web.reactive.result.view.RequestContext#getContextUrl(String, Map)
|
||||
*/
|
||||
public String getContextUrl(String relativeUrl, Map<String,String> params) {
|
||||
UriTemplate template = new UriTemplate(relativeUrl);
|
||||
return getContextPath() + template.expand(params).toASCIIString();
|
||||
UriComponents uric = UriComponentsBuilder.fromUriString(relativeUrl).buildAndExpand(params);
|
||||
return getContextPath() + uric.toUri().toASCIIString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user