您如何使用" http://test.com/#/signup"创建UriComponentsBuilder?成功?以下代码将抛出无效的HTTP URL。
UriComponentsBuilder builder = UriComponentsBuilder
.fromHttpUrl("http://test.com/#/signup");
答案 0 :(得分:0)
您可以先尝试构建URI
,然后使用它来初始化构建器:
URI uri = new URI.create("http://test.com/#/signup");
// hash part going to be available like this
String fragment = uri.getFragment();
UriComponentsBuilder builder = UriComponentsBuilder.fromUri(uri);